workaround for node.js bug https://github.com/nodejs/node/issues/21398#11
Open
timotab wants to merge 1 commit intowmnnd:masterfrom
Open
workaround for node.js bug https://github.com/nodejs/node/issues/21398#11timotab wants to merge 1 commit intowmnnd:masterfrom
timotab wants to merge 1 commit intowmnnd:masterfrom
Conversation
apparentorder
added a commit
to apparentorder/lambda-watchtower
that referenced
this pull request
Jun 24, 2020
Per Node documentation, any response (http.IncomingMessage -> stream.Readable) must be fully consumed. Otherwise, reading data will block, once the internal buffer is full. Effectively this caused http targets with a large enough response body to always run until the configured timeout is reached. This also causes the 'end' event not to fire. References: - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_buffering: "Once the total size of the internal read buffer reaches the threshold specified by highWaterMark, the stream will temporarily stop reading data from the underlying resource until the data currently buffered can be consumed" - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_event_end: "The 'end' event will not be emitted unless the data is completely consumed." Fixes wmnnd#11.
apparentorder
added a commit
to apparentorder/lambda-watchtower
that referenced
this pull request
Jun 24, 2020
Per Node documentation, any response (http.IncomingMessage -> stream.Readable) must be fully consumed. Otherwise, reading data will block, once the internal buffer is full. Effectively this caused http targets with a large enough response body to always run until the configured timeout is reached. This also causes the 'end' event not to fire. References: - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_buffering: "Once the total size of the internal read buffer reaches the threshold specified by highWaterMark, the stream will temporarily stop reading data from the underlying resource until the data currently buffered can be consumed" - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_event_end: "The 'end' event will not be emitted unless the data is completely consumed." Fixes wmnnd#11.
apparentorder
added a commit
to apparentorder/lambda-watchtower
that referenced
this pull request
Jun 24, 2020
Per Node documentation, any response (http.IncomingMessage -> stream.Readable) must be fully consumed. Otherwise, reading data will block, once the internal buffer is full. Effectively this caused http targets with a large enough response body to always run until the configured timeout is reached. This also causes the 'end' event not to fire. References: - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_buffering: "Once the total size of the internal read buffer reaches the threshold specified by highWaterMark, the stream will temporarily stop reading data from the underlying resource until the data currently buffered can be consumed" - https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_event_end: "The 'end' event will not be emitted unless the data is completely consumed." Fixes wmnnd#11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a bug in the version of Node.js 10.x that Lambda uses that causes the http request 'end' event to not be fired. see nodejs/node#21398
This results in the "close" and therefore "total" timings to be the timeout value, instead of the actual URL load end value. Example graph (with calculated items to change from milliseconds to seconds) shows the results for www.google.com as I adjusted the timeout values: 6s, 10s, 30s, 60s.
Workaround listed on the nodejs issues page applied to this code fixes the problem.