Skip to content

Can't read/write to the same cosocket from different threads #241

Closed
@AdallomRoy

Description

@AdallomRoy

It's impossible with the current implementation to read from thread 1 and write from thread 2 to the same socket.
This causes issues in tunnel cases - if I wanted to create a tunnel between 2 connections I'd run 2 threads, 1 reading from socket A and writing to socket B, the other reading from socket B and writing to socket A - which is currently impossible ("socket busy") - even though this supported by nginx itself.
This is caused by the fact that there isn't a separation of read & write state for each socket -
ngx_http_lua_co_ctx_t *co_ctx;
and
unsigned waiting:1;
are for both read & write operations - They should probably be separated.

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