Skip to content

wasip3: Closing a socket resource does not always close the socket #11342

@alexcrichton

Description

@alexcrichton

Currently there is liberal use of Arc<...> in the WASIp3 wasi:sockets implementation which is used for sharing sockets between tasks which are used to implement streams. One example is that a stream of clients can be extracted from a TCP listener, meaning that the underlying socket is now shared between the original TCP listener resource and the stream that is reading clients. The consequence of this implementation is that when the resource is closed it does not mean that the actual socket is itself closed. For example the OS-level port remains reserved until the task for accepted clients also exits. While the tasks will "promptly exit" there is currently no reliable mechanism to await this happening.

This leads to tests for REUSEADDR, for example, having a loop around re-binding a port and asserting it's successful. This test is being added in #11291.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasi:implIssues pertaining to WASI implementation in Wasmtimewasm-proposal:component-model-asyncIssues related to the WebAssembly Component Model async proposal

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions