Skip to content

Commit 78dfa54

Browse files
committed
Merge tag '1.3.6'
LogTape 1.3.6
2 parents 3501100 + 1b9d6c6 commit 78dfa54

4 files changed

Lines changed: 76 additions & 7 deletions

File tree

.markdownlint-cli2.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ export default {
2525
"tables": false,
2626
},
2727
},
28+
ignores: ["**/node_modules/**"],
2829
};

CHANGES.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ To be released.
149149
[#115]: https://github.com/dahlia/logtape/pull/115
150150

151151

152+
Version 1.3.6
153+
-------------
154+
155+
Released on January 7, 2026.
156+
157+
### @logtape/cloudwatch-logs
158+
159+
- Fixed `getCloudWatchLogsSink()` to properly close internally created
160+
`CloudWatchLogsClient` connections on disposal. Previously, when the sink
161+
created its own client (i.e., when `options.client` was not provided),
162+
the client's TLS connections were not closed, causing resource leaks that
163+
were detected by Deno's stricter resource leak checking in newer versions.
164+
165+
152166
Version 1.3.5
153167
-------------
154168

@@ -448,6 +462,20 @@ Released on December 15, 2025.
448462
- Added `SyslogTlsOptions.ca` option to specify custom CA certificates.
449463

450464

465+
Version 1.2.6
466+
-------------
467+
468+
Released on January 7, 2026.
469+
470+
### @logtape/cloudwatch-logs
471+
472+
- Fixed `getCloudWatchLogsSink()` to properly close internally created
473+
`CloudWatchLogsClient` connections on disposal. Previously, when the sink
474+
created its own client (i.e., when `options.client` was not provided),
475+
the client's TLS connections were not closed, causing resource leaks that
476+
were detected by Deno's stricter resource leak checking in newer versions.
477+
478+
451479
Version 1.2.5
452480
-------------
453481

@@ -586,6 +614,20 @@ Released on November 11, 2025.
586614
[#94]: https://github.com/dahlia/logtape/issues/94
587615
588616
617+
Version 1.1.8
618+
-------------
619+
620+
Released on January 7, 2026.
621+
622+
### @logtape/cloudwatch-logs
623+
624+
- Fixed `getCloudWatchLogsSink()` to properly close internally created
625+
`CloudWatchLogsClient` connections on disposal. Previously, when the sink
626+
created its own client (i.e., when `options.client` was not provided),
627+
the client's TLS connections were not closed, causing resource leaks that
628+
were detected by Deno's stricter resource leak checking in newer versions.
629+
630+
589631
Version 1.1.7
590632
-------------
591633

packages/cloudwatch-logs/src/sink.integration.test.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ import { assertEquals, assertInstanceOf } from "@std/assert";
1313
import process from "node:process";
1414
import { getCloudWatchLogsSink } from "./sink.ts";
1515

16-
type Describe = (name: string, run: () => void | Promise<void>) => void;
17-
18-
let test: Describe & { skip?: Describe } = suite(import.meta);
16+
type Describe = {
17+
(name: string, run: () => void | Promise<void>): void;
18+
(
19+
name: string,
20+
options: { sanitizeResources?: boolean; sanitizeOps?: boolean },
21+
run: () => void | Promise<void>,
22+
): void;
23+
skip?: Describe;
24+
};
25+
26+
let test: Describe = suite(import.meta) as Describe;
1927

2028
// Skip integration tests unless AWS credentials are provided
2129
// Also skip on Bun due to AWS SDK response parsing issues
@@ -42,7 +50,10 @@ if (skipIntegrationTests) {
4250
const testLogGroupName = `/logtape/integration-test-${Date.now()}`;
4351
const testLogStreamName = `test-stream-${Date.now()}`;
4452

45-
test("Integration: CloudWatch Logs sink with real AWS service", async () => {
53+
test("Integration: CloudWatch Logs sink with real AWS service", {
54+
sanitizeResources: false,
55+
sanitizeOps: false,
56+
}, async () => {
4657
const client = new CloudWatchLogsClient({
4758
region: process.env.AWS_REGION,
4859
credentials: {
@@ -137,10 +148,14 @@ test("Integration: CloudWatch Logs sink with real AWS service", async () => {
137148
} catch (error) {
138149
console.warn("Failed to cleanup test log group:", error);
139150
}
151+
client.destroy();
140152
}
141153
});
142154

143-
test("Integration: CloudWatch Logs sink with batch processing", async () => {
155+
test("Integration: CloudWatch Logs sink with batch processing", {
156+
sanitizeResources: false,
157+
sanitizeOps: false,
158+
}, async () => {
144159
const client = new CloudWatchLogsClient({
145160
region: process.env.AWS_REGION,
146161
credentials: {
@@ -230,10 +245,14 @@ test("Integration: CloudWatch Logs sink with batch processing", async () => {
230245
} catch (error) {
231246
console.warn("Failed to cleanup batch test log group:", error);
232247
}
248+
client.destroy();
233249
}
234250
});
235251

236-
test("Integration: CloudWatch Logs sink with credentials from options", async () => {
252+
test("Integration: CloudWatch Logs sink with credentials from options", {
253+
sanitizeResources: false,
254+
sanitizeOps: false,
255+
}, async () => {
237256
const credentialsTestLogGroupName = `/logtape/credentials-test-${Date.now()}`;
238257
const credentialsTestLogStreamName = `credentials-test-stream-${Date.now()}`;
239258

@@ -333,10 +352,14 @@ test("Integration: CloudWatch Logs sink with credentials from options", async ()
333352
} catch (error) {
334353
console.warn("Failed to cleanup credentials test log group:", error);
335354
}
355+
client.destroy();
336356
}
337357
});
338358

339-
test("Integration: CloudWatch Logs sink with JSON Lines formatter", async () => {
359+
test("Integration: CloudWatch Logs sink with JSON Lines formatter", {
360+
sanitizeResources: false,
361+
sanitizeOps: false,
362+
}, async () => {
340363
const structuredTestLogGroupName = `/logtape/structured-test-${Date.now()}`;
341364
const structuredTestLogStreamName = `structured-test-stream-${Date.now()}`;
342365

@@ -447,5 +470,6 @@ test("Integration: CloudWatch Logs sink with JSON Lines formatter", async () =>
447470
} catch (error) {
448471
console.warn("Failed to cleanup structured test log group:", error);
449472
}
473+
client.destroy();
450474
}
451475
});

packages/cloudwatch-logs/src/sink.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const OVERHEAD_PER_EVENT = 26; // AWS overhead per log event: 26 bytes per event
2727
export function getCloudWatchLogsSink(
2828
options: CloudWatchLogsSinkOptions,
2929
): Sink & AsyncDisposable {
30+
const ownClient = options.client == null;
3031
const client = options.client ??
3132
new CloudWatchLogsClient({
3233
region: options.region ?? "us-east-1",
@@ -161,6 +162,7 @@ export function getCloudWatchLogsSink(
161162
}
162163
await flushEvents();
163164
disposed = true;
165+
if (ownClient) client.destroy();
164166
};
165167

166168
return sink;

0 commit comments

Comments
 (0)