Skip to content

Commit 06361b4

Browse files
committed
Bump high water mark when downloading bundle to 16 MB
1 parent 8c3a732 commit 06361b4

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

lib/tar.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tar.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-download.js

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-download.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tar.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ export async function extractTarZst(
142142
logger: Logger,
143143
): Promise<string> {
144144
const dest = await createExtractFolder();
145+
logger.debug(
146+
`Extracting to ${dest}.${
147+
tar instanceof stream.Readable
148+
? ` Input stream has high water mark ${tar.readableHighWaterMark}.`
149+
: ""
150+
}`,
151+
);
145152

146153
try {
147154
// Initialize args

src/tools-download.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IncomingMessage, OutgoingHttpHeaders } from "http";
1+
import { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from "http";
22
import * as path from "path";
33
import { performance } from "perf_hooks";
44

@@ -11,6 +11,11 @@ import { formatDuration, Logger } from "./logging";
1111
import * as tar from "./tar";
1212
import { cleanUpGlob } from "./util";
1313

14+
/**
15+
* High watermark to use when streaming the download and extraction of the CodeQL tools.
16+
*/
17+
export const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB
18+
1419
/**
1520
* Timing information for the download and extraction of the CodeQL tools when
1621
* we fully download the bundle before extracting.
@@ -182,7 +187,14 @@ async function downloadAndExtractZstdWithStreaming(
182187
headers,
183188
);
184189
const response = await new Promise<IncomingMessage>((resolve) =>
185-
https.get(codeqlURL, { headers }, (r) => resolve(r)),
190+
https.get(
191+
codeqlURL,
192+
{
193+
headers,
194+
highWaterMark: STREAMING_HIGH_WATERMARK_BYTES,
195+
} as unknown as RequestOptions,
196+
(r) => resolve(r),
197+
),
186198
);
187199

188200
if (response.statusCode !== 200) {

0 commit comments

Comments
 (0)