Skip to content

sockets.close behaviour when closed already rejected #24

Open
@dom96

Description

@dom96

From cloudflare/workerd#1305 we've realised that we should define what should happen when close is called on a socket that already had its closed promise rejected.

When the closed promise is resolved then the answer is easy: close does nothing.

But when closed is rejected, we have a couple of options:

  • close throws the exception in closed
  • close doesn't throw and leaves the closed promise unchanged (so it remains rejected)

Workerd currently does a third option, which I think just leads to gotchas so I want to change it, where close doesn't throw but also resolves the closed promise which means the exception can be lost.

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