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

http: Adding doc and debug for calling empty string on write function #22118

Closed
wants to merge 1 commit into from

Conversation

antsmartian
Copy link
Contributor

@antsmartian antsmartian commented Aug 4, 2018

Addresses the issue : #22066

Removing the empty check would be a breaking change, however I'm not sure why such check is in first place. May be need input from the community.

In the meantime, I thought its worth to add documentation and at the same time to add debug log, so that when users feel write with empty string or buffer hangs, they can run in debug mode to find out the reason.

If the content fits for the documentation, I guess we need to add the same to http2 as well.

Open to feedbacks and thoughts.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Aug 4, 2018
doc/api/http.md Outdated
@@ -750,6 +750,9 @@ Returns `true` if the entire data was flushed successfully to the kernel
buffer. Returns `false` if all or part of the data was queued in user memory.
`'drain'` will be emitted when the buffer is free again.

Note that when `write` is called with empty string or buffer, it does nothing and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter issue: 80 characters per line limit exceeded.

@Trott
Copy link
Member

Trott commented Aug 5, 2018

@nodejs/http

@antsmartian
Copy link
Contributor Author

@jasnell I guess its worth to add the same for http2 module as well right? I remember, we do handle the empty string/buffer the same way.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/16604/

I guess its worth to add the same for http2 module as well right? I remember, we do handle the empty string/buffer the same way.

@antsmartian Yes in compatibility mode.

@jasnell
Copy link
Member

jasnell commented Aug 20, 2018

Oh, sorry, missed the earlier ping. Yes, what @mcollina said :-)

doc/api/http.md Outdated
@@ -750,6 +750,9 @@ Returns `true` if the entire data was flushed successfully to the kernel
buffer. Returns `false` if all or part of the data was queued in user memory.
`'drain'` will be emitted when the buffer is free again.

Note that when `write` is called with empty string or buffer, it does
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, you can ignore this, but my mild preference: Remove Note that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, taken care.

@joyeecheung
Copy link
Member

This PR needs a rebase against master to avoid the git failure in the CI.

@antsmartian
Copy link
Contributor Author

@joyeecheung Taken care.

@mcollina
Copy link
Member

@mcollina
Copy link
Member

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 21, 2018
@jasnell
Copy link
Member

jasnell commented Aug 21, 2018

Unrelated CI failures are currently keeping this from landing. It's ready to go otherwise.

@Trott
Copy link
Member

Trott commented Aug 22, 2018

Unrelated CI failures are currently keeping this from landing. It's ready to go otherwise.

@jasnell Needs a rebase against master to get past the CI issues. The jinja LICENSE thing is the giveaway:

12:18:15 Changes not staged for commit:
12:18:15   (use "git add <file>..." to update what will be committed)
12:18:15   (use "git checkout -- <file>..." to discard changes in working directory)
12:18:15 
12:18:15 	modified:   deps/v8/third_party/jinja2/LICENSE
12:18:15 
12:18:15 Untracked files:
12:18:15   (use "git add <file>..." to include in what will be committed)
12:18:15 
12:18:15 	env.properties

OP can rebase, or any Collaborator can rebase and force push on their behalf. Start another CI and all will hopefully be better...

@Trott
Copy link
Member

Trott commented Aug 22, 2018

Rebased, force-pushed. New CI: https://ci.nodejs.org/job/node-test-pull-request/16666/

@mcollina
Copy link
Member

Landed in 413a7e1

@mcollina mcollina closed this Aug 22, 2018
mcollina pushed a commit that referenced this pull request Aug 22, 2018
PR-URL: #22118
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
targos pushed a commit that referenced this pull request Aug 24, 2018
PR-URL: #22118
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
targos pushed a commit that referenced this pull request Sep 3, 2018
PR-URL: #22118
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants