Skip to content

uv_fs_poll_t internal uv_fs_t prevents event loop close #1869

Closed
@addaleax

Description

@addaleax
  • Version: Current v1.x head
  • Platform: At least all UNIX

uv_fs_poll_t uses stat requests internally. However, such an internal request may be pending even when the close callback for uv_fs_poll_t is called; that doesn’t seem right to me? In particular, after the close callback, from a library user’s point of view it looks like the event loop can be closed, but that fails because the stat req is still active.

There’s also this TODO comment by @bnoordhuis that seems very related:

uv_fs_t fs_req; /* TODO(bnoordhuis) mark fs_req internal */

I’m not sure how exactly that would look like, though.

addaleax@78ea583 has a regression test for this.

Activity

bnoordhuis

bnoordhuis commented on Jun 8, 2018

@bnoordhuis
Member

I think that can be fixed by postponing the close callback until the internal timer handle and fs request have closed/finished.

Right now uv_close() calls uv__make_close_pending() (uv_want_endgame() on Windows) immediately but that needs to be delayed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      uv_fs_poll_t internal uv_fs_t prevents event loop close · Issue #1869 · libuv/libuv