-
Notifications
You must be signed in to change notification settings - Fork 833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[next] Add support for node 20 #4331
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
matrix: | ||
node_version: | ||
- "18" | ||
# - "20" # disabled until http instrumentation can be fixed | ||
- "20" | ||
runs-on: ubuntu-latest | ||
env: | ||
NPM_CONFIG_UNSAFE_PERM: true | ||
|
@@ -40,7 +40,7 @@ jobs: | |
npm run test | ||
- name: Report Coverage | ||
run: npm run codecov | ||
if: ${{ matrix.node_version == '18' }} | ||
if: ${{ matrix.node_version == '20' }} | ||
node-windows-tests: | ||
runs-on: windows-latest | ||
env: | ||
|
@@ -51,7 +51,7 @@ jobs: | |
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
node-version: 20 | ||
|
||
- run: npm install -g npm@latest | ||
|
||
|
@@ -77,7 +77,7 @@ jobs: | |
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
|
||
- name: Bootstrap | ||
run: npm ci | ||
|
@@ -98,7 +98,7 @@ jobs: | |
uses: actions/[email protected] | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
|
||
- name: Bootstrap | ||
run: npm ci | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,6 +330,9 @@ export class HttpInstrumentation extends InstrumentationBase<Http> { | |
'response', | ||
(response: http.IncomingMessage & { aborted?: boolean }) => { | ||
this._diag.debug('outgoingRequest on response()'); | ||
if (request.listenerCount('request') <= 0) { | ||
response.resume(); | ||
} | ||
Comment on lines
+333
to
+335
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are the only listener, we have to make sure to read the response data. Otherwise the connection is never closed. |
||
const responseAttributes = | ||
utils.getOutgoingRequestAttributesOnResponse(response); | ||
span.setAttributes(responseAttributes); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ export async function sendRequestTwice( | |
port: number | ||
): Promise<Buffer> { | ||
return new Promise((resolve, reject) => { | ||
const request = 'GET /raw HTTP/1.1\n\n'; | ||
const request = `GET /raw HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to spec |
||
const socket = net.createConnection({ host, port }, () => { | ||
socket.write(`${request}${request}`, err => { | ||
if (err) reject(err); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naive Q: should that eventName be
response
?