Skip to content

uv_write() for pipes on Windows does not always call callback #1729

Closed

Description

@addaleax
  • Version: 1.19.1 (Node master)
  • Platform: Windows 10

Hi everyone! I'm currently debugging some of my Node work, and I'm pretty sure uv_write() callbacks for Windows pipes don't always get called (even though the other side of the pipe fully received the data).

I'll try to get a pure libuv reproduction together, but the easiest way to reproduce would be something along the lines of adding a fprintf(stderr, "foobar\n"); to Node's LibuvStreamWrap::AfterWrite(), then running a test like test\parallel\test-cluster-cwd.js -- it writes data, the other side receives it, and it does use uv_write() for writing, but there's no extra output.

Activity

  1. bzoz commented on Feb 20, 2018

    @bzoz
    Member

    @addaleax if you change slaves process.send to

      process.send(process.cwd(), () => {
        process.disconnect();
      });

    the fprints start to appear. Does this makes sense, or do you still think there is some issue here?

  2. addaleax commented on Feb 20, 2018

    @addaleax
    ContributorAuthor

    @bzoz I don’t think that’s a solution, no… the writes should still be reported back as finished, even without an explicit disconnect, right? That’s true for all other kinds of libuv streams

  3. bzoz commented on Feb 20, 2018

    @bzoz
    Member

    I mean, it looks like the process exits before callbacks can be called. If you drop the process.disconnect() altogether, the fprints also start to appear (but the test never finishes).

  4. stale commented on Aug 10, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions