lxc-attach: fix data corruption during heavy IO on PTS#4633
lxc-attach: fix data corruption during heavy IO on PTS#4633
Conversation
…o handlers Previously, lxc_write_nointr could return without writing all data when write() returned EAGAIN/EWOULDBLOCK due to buffer full conditions. This change: - Implements a loop to continue writing until all data is sent - Handles EINTR, EAGAIN, and EWOULDBLOCK errors appropriately - Uses poll() to wait for fd to become ready when blocked - Maintains backward compatibility while fixing partial write issues Signed-off-by: DreamConnected <[email protected]> [ alex ] - introduce a separate helper lxc_write_all and use it only in ptx/peer io handlers - cleanup the code a bit Signed-off-by: Alexander Mikhalitsyn <[email protected]>
13fb6c6 to
b4a57a1
Compare
|
It seems that the |
c7e77d3 to
cd80055
Compare
…n pts Signed-off-by: Alexander Mikhalitsyn <[email protected]>
cd80055 to
97bd769
Compare
yep, the reason was that depending on at which point of time |
|
Okay, now everything looks green :) |
|
Just for the history. In a new test case I mentioned a bug in Busybox this is a reproducer (of course, not involving LXC anyhow): this will stuck forever. If we add |
viceice
left a comment
There was a problem hiding this comment.
do you see a possibility to get this fix into current debian stable?
|
That'd be one for @gibmat as he's the packager for Debian. |
Staged at https://salsa.debian.org/lxc-team/lxc/-/commit/4615978f082ebe26dc4908f1bd235d48a341ba83 for the 13.4 stable point release, planned for March 14. |
Replacing `lxc-attach` with `nsenter` continues to cause problems, currently #1341, but previously #1326 and #1336. As we have an upstream fix in lxc/lxc#4633, I don't think I can justify any further effort in fixing the `nsenter` behaviour. This PR reverts the change and restores the 100 MiB in-memory buffer -- that buffer can & should be removed when 4633 is broadly available. All tests added in #1326 and #1336 are retained. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1317): <!--number 1317 --><!--line 0 --><!--description Zml4OiByZXZlcnQgc3dpdGNoIGZyb20gbHhjLWF0dGFjaCB0byBuc2VudGVy-->fix: revert switch from lxc-attach to nsenter<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1317 Reviewed-by: Andreas Ahlenstorf <[email protected]> Co-authored-by: Mathieu Fenniak <[email protected]> Co-committed-by: Mathieu Fenniak <[email protected]>
Reworked version of #4597 with testcase.
Authorship of @DreamConnected is preserved, of course.
Fixes: #4546