Closed pvdrz closed 1 year ago
Number of dependencies and binary size impact report
Metric | main | PR #624 | Delta |
---|---|---|---|
Direct dependencies | 3 | 3 | - |
Total dependencies | 4 | 4 | - |
Binary size | 1001.6 KiB | 1001.6 KiB | - |
Text size | 580 KiB | 580.2 KiB | - |
Patch coverage: 47.82
% and project coverage change: -0.14
:warning:
Comparison is base (
636351d
) 86.51% compared to head (7122e28
) 86.37%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
mmm to be honest I think blocking is fine for all the cases, even when we don't poll the sockets. Because we actually want to block processes if we're waiting for stuff to arrive in the sockets. Like the "green light" message, or the "process PID" message.
But I agree that having the assertions inside Backchannel
is a better idea. So what about having two methods that just enable/disable the assertions instead: enable_non_blocking_assertions
and disable_non_blocking_assertions
?
I think my main concern is that, even without the assertions, if the sockets are set to nonblocking mode right after they are open and a blocking operation happens (e.g. the green light message) then any use of ?
could make a read / write early return and e.g. take down the monitor or any other process.
so, we should move that set_nonblocking
to right before we after using poll
. if we are going to add a enable_non_blocking_assertions
method then we may as well move the set_nonblocking
call into it -- and enable_non_blocking_assetions
should be called after 'green light' and before the poll loop.
mmm yeah I get your point.
The good thing is that we "busywait" in those cases where using the socket could fail due to EINTR
or EAGAIN
. So, the green light recv call will be retried until we get an error that's not Interrupted
or WouldBlock
.
Describe the changes done on this pull request This PR moves the assertions about the backchannel operations being not blocking to the event loop where the backchannel sockets are actually being polled.
Pull Request Checklist