Skip to content
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

headersTimeout triggered after headers have been received #268

Closed
ronag opened this issue Jul 29, 2020 · 5 comments
Closed

headersTimeout triggered after headers have been received #268

ronag opened this issue Jul 29, 2020 · 5 comments
Labels
Status: help-wanted This issue/pr is open for contributions

Comments

@ronag
Copy link
Member

ronag commented Jul 29, 2020

Run the following against a CouchDB 1.6 instance:

const { Client } = require('.')
const stream = require('stream')

const client = new Client('http://localhost:5984', {
  socketTimeout: 10e3,
  headersTimeout: 10e3
})

client.stream({
  method: 'GET',
  path: '/nxt/_changes?feed=continuous&heartbeat=5000'
}, ({ headers }) => {
  console.log(headers)
  return new stream.Writable({
    write (chunk, encoding, callback) {
      console.log(chunk.toString())
      callback()
    }
  })
}, (err) => {
  console.error(err)
})

Note that this is a long polling request.

It will log the headers and then after 10 seconds still fail with a headers timeout error.

Probably a problem in node_http_parser in Node?

@ronag ronag added bug Something isn't working Status: help-wanted This issue/pr is open for contributions labels Jul 29, 2020
ronag added a commit that referenced this issue Jul 29, 2020
@ronag
Copy link
Member Author

ronag commented Jul 29, 2020

Might be related to trailers?

ronag added a commit that referenced this issue Jul 29, 2020
@ronag ronag removed the bug Something isn't working label Jul 29, 2020
@ronag
Copy link
Member Author

ronag commented Jul 29, 2020

Added a workaround. Would be interesting to fix "properly".

@ronag
Copy link
Member Author

ronag commented Jul 29, 2020

Needs a test.

@ronag
Copy link
Member Author

ronag commented Jul 29, 2020

@addaleax I can't see where/how headers timeout is cleared in https://github.com/nodejs/node/blob/master/src/node_http_parser.cc? Any hints?

@ronag
Copy link
Member Author

ronag commented Jul 31, 2020

Node bug nodejs/node#34578

@ronag ronag closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: help-wanted This issue/pr is open for contributions
Projects
None yet
Development

No branches or pull requests

1 participant