go-zeromq / zmq4

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

Add timeout support on send #148

Closed egorse closed 9 months ago

egorse commented 9 months ago

Add internal/errorgrp package to support cancellable error groups Add tests for push/pull timeout

codecov[bot] commented 9 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (e16dc3e) 68.51% compared to head (2bf3109) 68.07%.

Files Patch % Lines
rep.go 50.00% 1 Missing :warning:
req.go 50.00% 1 Missing :warning:
socket.go 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #148 +/- ## ========================================== - Coverage 68.51% 68.07% -0.44% ========================================== Files 29 30 +1 Lines 2560 2600 +40 ========================================== + Hits 1754 1770 +16 - Misses 704 727 +23 - Partials 102 103 +1 ```

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

egorse commented 9 months ago

we don't exercize the whole errorgrp.Group2.Go code. we could probably try to make sure we still get the context error when it expires during the execution of f. (probably with a 2-level handshake where the cancel() happens when we are sure f is being executed)

This is sort of odd - I had impression that only block execution of f if context is already cancelled (i.e. if the eg has limits on number of executable functions and parent context got cancelled prior next f in eg started). I will check it and update PR (include others suggestions)

update: Test case was missing

egorse commented 9 months ago

I think its ready for next review cycle. Please comment

egorse commented 9 months ago

Please take a look. Still not sure how well it is on implicit errgroup.Group initialization

egorse commented 9 months ago

Dough - original init() was nicer for codecov. Will wait for your comments