Skip to content
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

FIFO may cause WouldBlock error #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zmrush
Copy link

@zmrush zmrush commented May 24, 2024

if FIFO stdin set non-block, process in container may open stdin by block method and it will cause WouldBlock error when it read from stdin

@github-actions github-actions bot added the C-runc runc helper label May 24, 2024
@zmrush zmrush force-pushed the fixbug-for-FIFO-WouldBlock branch from 9c9f92f to 7c1f137 Compare May 24, 2024 04:02
…lock method and it will cause WouldBlock error when it read from stdin
@zmrush zmrush force-pushed the fixbug-for-FIFO-WouldBlock branch from 7c1f137 to 5761974 Compare May 24, 2024 06:33
@zmrush
Copy link
Author

zmrush commented May 24, 2024

@kzys @dims @caniszczyk @tianon hi,can anyone see this commit?thanks

@zmrush
Copy link
Author

zmrush commented May 27, 2024

@mxpv can u check this commit?

@Burning1020
Copy link
Member

Hi, @zmrush Do we have another solution? I'm not sure if opening it with O_NONBLOCK and then removing it afterward is a good approach.

@zmrush
Copy link
Author

zmrush commented May 28, 2024

E6A4E474-267D-4EBF-AB03-85BCCEBFF9FA

In fact,there is no fifo(Typed IO) in containerd, containerd has pipedio only and pipedio open stdin(pipe) with block flag. but our fifo open fd with non-block,which is inconsistent. But if I remove the code(.custom_flags(libc::O_NONBLOCK)) of fifo and open fifo-file with O_BLOCK,the set method of FIFO is blocked by our unit-test and unit-test failed. So i only can modify the O_NONBLOCK flag afterward like this commit. So if we can change our unit test, then we only remove the code (.custom_flags(libc::O_NONBLOCK)). If we do not change our unit test, I can only rewrite the code with this commit. Wait for your reply @Burning1020

@Burning1020
Copy link
Member

But if I remove the code(.custom_flags(libc::O_NONBLOCK)) of fifo and open fifo-file with O_BLOCK,the set method of FIFO is blocked by our unit-test and unit-test failed.

That's also the reason why I add this flag at the first init.
I just feel a little awkward, CC @mxpv @abel-von @jsturtevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-runc runc helper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants