go-zeromq / zmq4

[WIP] Pure-Go implementation of ZeroMQ-4
BSD 3-Clause "New" or "Revised" License
341 stars 56 forks source link

Fix connection reaper deadlock. #150

Closed egorse closed 8 months ago

egorse commented 8 months ago

Added explicitly running test to detect deadlock. Use go test -tags=TestConnReaperDeadlockLoop -run ^TestConnReaperDeadlockLoop$. Be aware the test generate a lot of sockets in TIME_WAIT. Without patch to socket.go it breaks pretty quick on fast and slow machines. With the patch it runs up to default test timeout (10m) but gets slower when there are plenty of sockets in TIME_WAIT.

Fixes #149

egorse commented 8 months ago

Dont get whats wrong with TestXPubSub - I ran it only in loop for almost 24h - no single failure

egorse commented 8 months ago

I will try to find way to make test with single pass to hit the deadlock. Please give me couple of days

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (16ca7c0) 68.19% compared to head (66d39ee) 68.22%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #150 +/- ## ========================================== + Coverage 68.19% 68.22% +0.03% ========================================== Files 30 30 Lines 2600 2603 +3 ========================================== + Hits 1773 1776 +3 Misses 724 724 Partials 103 103 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

egorse commented 8 months ago

I think the test is now ready but it might looks more ugly even can repro problem each run. Please comment