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

doc: clarify lifecycle of domain sockets #19471

Merged
merged 1 commit into from
Apr 6, 2018

Conversation

gireeshpunathil
Copy link
Member

In UNIX, the domain sockets once created persists until unlinked.
Clarify which ones are persisted and which ones are cleared manually.

In Windows, named pipes are cleared based on reference count,
implemented by the underlying system. Disambiguate this from
Garbage collection of the Node.js runtime.

Refs: nodejs/help#1080

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem. labels Mar 20, 2018
doc/api/net.md Outdated
on file creation. If the UNIX domain socket (that is visible as a file system
path) is created and used in conjunction with one of Node.js' API abstractions
such as [`net.createServer()`][], it will be unlinked as part of
[`server.close()`][]. On the other hand, if it is created and used otuside of
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: otuside -> outside

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @vsemozhetbyt - fixed.

@vsemozhetbyt vsemozhetbyt added the fast-track PRs that do not need to wait for 48 hours to land. label Mar 20, 2018
doc/api/net.md Outdated
persist*, they are removed when the last reference to them is closed. Do not
forget JavaScript string escaping requires paths to be specified with
double-backslashes, such as:
persist*, they are removed when the last reference to them is closed - managed
Copy link
Member

Choose a reason for hiding this comment

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

Hmm...So before you edited it, this sentence was already a run-on sentence due to the comma splice. I'm not sure I understand the material your adding in this paragraph. Does this seem right?:

Pipes will *not persist*. They are removed when the last reference to them is closed.
Unlike UNIX domain sockets, Windows will close and remove the pipe when the process
exits.

JavaScript string escaping requires paths to be specified with extra backslash escaping
such as:

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @Trott - addressed, incorporated your text as it is with only a single word addition.

@Trott
Copy link
Member

Trott commented Mar 20, 2018

Nit: While we're editing these paragraphs, maybe fix path name -> pathname (consistent with other docs) and name space -> namespace (also consistent with other docs)?

@Trott
Copy link
Member

Trott commented Mar 20, 2018

@nodejs/documentation

doc/api/net.md Outdated
persist*, they are removed when the last reference to them is closed. Do not
forget JavaScript string escaping requires paths to be specified with
double-backslashes, such as:
sequences. Despite appearances, the pipe namespace is flat. Pipes will
Copy link
Member

Choose a reason for hiding this comment

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

Despite how it might look or despite appearance?

Copy link
Member

Choose a reason for hiding this comment

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

"Despite appearances" is idiomatic US English. Don't know that I've ever heard "Despite appearance" and it would make me think the writer forgot the s at the end of appearance. "Despite how it might look" is a fine alternative.

Copy link
Member Author

Choose a reason for hiding this comment

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

@benjamingr @Trott - addressed, thanks.

on file creation. It will be visible in the filesystem, and will *persist until
unlinked*.
on file creation. If the UNIX domain socket (that is visible as a file system
path) is created and used in conjunction with one of Node.js' API abstractions
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is clear to be honest, I think an example would help more.

Copy link
Member Author

Choose a reason for hiding this comment

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

@benjamingr - Can you please clarify what is not clear? and example for what?

Copy link
Member Author

Choose a reason for hiding this comment

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

ping @benjamingr to see what can be done.

Copy link
Member

Choose a reason for hiding this comment

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

@gireeshpunathil I'm not blocking - I'm just not sure the description here is less confusing than before. I don't have any ideas as to what I'd write differently - sorry!

Copy link
Member Author

Choose a reason for hiding this comment

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

@benjamingr - thanks, sure. I have asked the OP ( @boneskull ) to have a look too to see if any improvements can be made. Else I will move towards landing, thanks!

In UNIX, the domain sockets once created persists until unlinked.
Clarify which ones are persisted and which ones are cleared manually.

In Windows, named pipes are cleared based on reference count,
implemented by the underlying system. Disambiguate this from
Garbage collection of the Node.js runtime.

Refs: nodejs/help#1080
@gireeshpunathil
Copy link
Member Author

@gireeshpunathil gireeshpunathil added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 6, 2018
gireeshpunathil added a commit that referenced this pull request Apr 6, 2018
In UNIX, the domain sockets once created persists until unlinked.
Clarify which ones are persisted and which ones are cleared manually.

In Windows, named pipes are cleared based on reference count,
implemented by the underlying system. Disambiguate this from
Garbage collection of the Node.js runtime.

Refs: nodejs/help#1080
PR-URL: #19471
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
@gireeshpunathil gireeshpunathil merged commit 8ca426c into nodejs:master Apr 6, 2018
@gireeshpunathil
Copy link
Member Author

the PR is landed, but I am wondering whether something went wrong or not - it had a merge conflict that I manually resolved by following the merge conflict resolve sequence through the command line. everything looks reasonable, except that it produced 2 more commits. Are we good here? @Trott / @joyeecheung

@lpinca
Copy link
Member

lpinca commented Apr 6, 2018

I think it's too late for a force push. The allowed window is 10 min.

@gireeshpunathil
Copy link
Member Author

@lpinca - but what went wrong? what needs to be reverted now?

@lpinca
Copy link
Member

lpinca commented Apr 6, 2018

I honestly don't know.

what needs to be reverted now?

Nothing, I guess.

@gireeshpunathil
Copy link
Member Author

thanks, good to know!

@Trott
Copy link
Member

Trott commented Apr 6, 2018

I think we should force push out those merge commits, but they've been there for two hours so I'd like another opinion. @nodejs/release @nodejs/tsc

@MylesBorins
Copy link
Member

I'd say +1... but would want more TSC people to chime in

@evanlucas
Copy link
Contributor

+1 from me

@addaleax
Copy link
Member

addaleax commented Apr 6, 2018

@gireeshpunathil this would need to be re-landed now... re-opening the PR doesn't work, unfortunately.

(But if there are conflicts, maybe open another PR anyway?)

@Trott
Copy link
Member

Trott commented Apr 6, 2018

I'm re-landing now. There don't appear to be any conflicts...

@Trott
Copy link
Member

Trott commented Apr 6, 2018

make test-doc is failing on master. 😞

@lpinca
Copy link
Member

lpinca commented Apr 6, 2018

Unrelated question: should we increase the allowed force push window to something bigger than 10 min? @gireeshpunathil noticed the issue ~18 min after landing and I suggested to not force push as 10 min had already passed.

@Trott
Copy link
Member

Trott commented Apr 6, 2018

Ignore me: make test-doc is not failing. Landing!

Trott pushed a commit to Trott/io.js that referenced this pull request Apr 6, 2018
In UNIX, the domain sockets once created persists until unlinked.
Clarify which ones are persisted and which ones are cleared manually.

In Windows, named pipes are cleared based on reference count,
implemented by the underlying system. Disambiguate this from
Garbage collection of the Node.js runtime.

Refs: nodejs/help#1080

PR-URL: nodejs#19471
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
@Trott
Copy link
Member

Trott commented Apr 6, 2018

Landed in 53aaa55

@addaleax
Copy link
Member

addaleax commented Apr 6, 2018

@lpinca I still think 10 min is a good interval for the more common types of problems, that can be fixed by sending a quick fix-up PR or commenting metadata under the commits or something similar

Maybe we could document the option of pinging the TSC explicitly? (Like, we can't 100 % outlaw force-pushes after more than 10 minutes anyway -- it's always going to be possible that we have to amend or remove commits for legal reasons.)

@lpinca
Copy link
Member

lpinca commented Apr 6, 2018

Maybe something slightly bigger (15 min?) is more appropriate? GitHub notifications are fast but not instant and not all collaborators are on IRC.

@Trott
Copy link
Member

Trott commented Apr 6, 2018

I'm not strictly opposed to increasing the time, but two things to consider:

  • I don't think a bigger window would have helped here. Basically, the 10-minute window is "oops, I better fix this"! Things that you know you messed up and want to fix quickly. Anything that requires a bit of conversation/coordination is likely to have to be escalated to TSC anyway. A smaller window means it gets escalated faster, which is a good thing.

  • Changing it means that some people will think it's 10 minutes and other people will think it's whatever it gets changed to, because not everybody gets the memo when we make a rule change. Therefore, we should be very judicious in changing rules/guidelines. (I mean, it's not the end of the world if someone doesn't know they have 15 minutes instead of 10, but just as a general principle, we probably shouldn't make rule changes that aren't high-value.)

@lpinca
Copy link
Member

lpinca commented Apr 6, 2018

I don't think a bigger window would have helped here.

In this particular case If it was a little bigger I would have suggested to @gireeshpunathil to force push but it was almost twice the allowed time.

I agree with the other points though.

@gireeshpunathil
Copy link
Member Author

Apologies for causing the mess. I take the blame for not fully understanding the process, and promise to be better next time. Thanks to the team those who stepped in and acted instantly to clean it!

Looking back at what has happened:

  • The PR lands through regular proceedings, the file (doc/api/net.md) did not show any conflict in the web interface
  • After the git push, I notice the error message relating to 'merge conflict' on the file, in the web ui.
  • It (the web ui) offered a 'solution' with a button - 'resolve merge conflicts automatically' or similar.
  • I recollected the first point in collaborator guide Never use GitHub's green "Merge Pull Request" button. but then mistook it to be the problem only if you use it through the UI. I followed its command line equivalent! , assuming that sequence will address the drawbacks of the web ui method.
  • I expected the command line alternative to do something similar to what git squash does.
  • Immediately after the git push I noticed the 2 extra commits, but was not sure whether it was so harmful!

Would increasing force push threshold have helped me in this case?

No. As my perception about the problem and idea of solving it was not coherent, 5 or 10 extra minutes would not make any difference.

However, IMO 10 minutes can be too less for someone (like me) to realize the issue, figure out what to do and apply the changes - of course it depends on the experience level of who lands PRs.

document the option of pinging the TSC explicitly?

+1 - yes, that will really help!

targos pushed a commit that referenced this pull request Apr 12, 2018
In UNIX, the domain sockets once created persists until unlinked.
Clarify which ones are persisted and which ones are cleared manually.

In Windows, named pipes are cleared based on reference count,
implemented by the underlying system. Disambiguate this from
Garbage collection of the Node.js runtime.

Refs: nodejs/help#1080

PR-URL: #19471
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
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. doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants