-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to retrieve exit code of a failed service call #183
Conversation
When service call fails, the remote (service) side sends EOF + exit code and closes the vchan immediately. If the client side tries to send something, it will fail and exit immediately (with code 1). But reading data that was queued in the vchan before its closing is still possible. So, on send error check if there is anything interesting to receive (especially exit code, but potentially also some service output) and, if yes, don't exit immediately. Since the service exit code is sent last (after all stdout/stderr data and their EOF), it's okay to check just for remote_status. This is relevant only to the service client side, as exit status of the service-handling process is not relevant. Fixes QubesOS/qubes-issues#9618
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
+ Coverage 79.05% 79.11% +0.05%
==========================================
Files 54 54
Lines 9916 9953 +37
==========================================
+ Hits 7839 7874 +35
- Misses 2077 2079 +2 ☔ View full report in Codecov by Sentry. |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024121004-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024111705-4.3&flavor=update
Failed tests5 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/119126#dependencies 1 fixed
Unstable tests
|
Check if the service exit code is correctly retrieved even if the the service terminates at the exact moment the qrexec-client tries to send some data. Try to win the race by initially sending SIGSTOP to the qrexec-client process, and sending SIGCONT only after preparing both local and remote data streams. qrexec-client will handle local data stream first, at which point remote socket is already closed. Similar issue applies to qrexec-client-vm, but since the implementation is shared, one test is enough. QubesOS/qubes-issues#9618
55fa313
to
df25090
Compare
When service call fails, the remote (service) side sends EOF + exit code
and closes the vchan immediately. If the client side tries to send
something, it will fail and exit immediately (with code 1). But reading
data that was queued in the vchan before its closing is still possible.
So, on send error check if there is anything interesting to receive
(especially exit code, but potentially also some service output) and, if
yes, don't exit immediately. Since the service exit code is sent last
(after all stdout/stderr data and their EOF), it's okay to check just
for remote_status.
This is relevant only to the service client side, as exit status of the
service-handling process is not relevant.
Fixes QubesOS/qubes-issues#9618