containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

[sync/server] wtc race maybe cause zero worker thread #230

Open yuqitao opened 3 months ago

yuqitao commented 3 months ago

Description of problem

wtc race maybe cause zero worker thread here. https://github.com/containerd/ttrpc-rust/blob/152ac12c30f65b79407d4411c40d8c86bc5ae949/src/sync/server.rs#L111

could reproduce it by add sleep 1s before https://github.com/containerd/ttrpc-rust/blob/152ac12c30f65b79407d4411c40d8c86bc5ae949/src/sync/server.rs#L112

Expected result

There is at least one worker thread for the accepted socket fd.

Actual result

Mabye there is no worker thread for the accepted socket fd.