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

podman create: Unable to close conn: \"close unixpacket @->/proc/self/fd/11/attach: use of closed network connection #11856

Closed
edsantiago opened this issue Oct 4, 2021 · 2 comments · Fixed by #11864
Assignees
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

New flake exposed by #11776:

# # podman create docker-archive:/tmp/podman_bats.lhLlzc/archive.tar
...
# dea245e90d8c9b4a645a71d9c20b8e80a3b913e3c41b5327016fe6d9a421533d
# # podman start --attach dea245e90d8c9b4a645a71d9c20b8e80a3b913e3c41b5327016fe6d9a421533d
# h6XQEUDR3lEH7VjgGUcd
# time="2021-10-01T07:26:23-05:00" level=error msg="Unable to close conn: \"close unixpacket @->/proc/self/fd/11/attach: use of closed network connection\""
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #|     FAIL: 'podman run' of 'podman-create docker-archive'
# #| expected: 'h6XQEUDR3lEH7VjgGUcd'
# #|   actual: 'h6XQEUDR3lEH7VjgGUcd'
# #|         > 'time="2021-10-01T07:26:23-05:00" level=error msg="Unable to close conn: \"close unixpacket @->/proc/self/fd/11/attach: use of closed network connection\""'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

sys: podman run docker-archive

Looking through cirrus-flake-grep, I see this happening as far back as June (when I started collecting logs). This is an old bug, not a new one.

@edsantiago edsantiago added the flakes Flakes from Continuous Integration label Oct 4, 2021
@edsantiago
Copy link
Member Author

another one

@Luap99
Copy link
Member

Luap99 commented Oct 5, 2021

The code will call close twice.

if err == nil {
if connErr := conn.CloseWrite(); connErr != nil {
logrus.Errorf("Unable to close conn: %q", connErr)
}
}

defer func() {
if err := conn.Close(); err != nil {
logrus.Errorf("Unable to close socket: %q", err)
}
}()

If CloseWrite is called before Close, everything is fine but if Close was called first, CloseWrite will fail.
I think we can just remove the CloseWrite call.

@Luap99 Luap99 self-assigned this Oct 5, 2021
Luap99 added a commit to Luap99/libpod that referenced this issue Oct 6, 2021
There is a race where `conn.Close()` was called before `conn.CloseWrite()`.
In this case `CloseWrite` will fail and an useless error is printed. To
fix this we move the the `CloseWrite()` call to the same goroutine to
remove the race. This ensures that `CloseWrite()` is called before
`Close()` and never afterwards.
Also fixed podman-remote run where the STDIN was never was closed.
This is causing flakes in CI testing.

[NO TESTS NEEDED]

Fixes containers#11856

Signed-off-by: Paul Holzinger <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Oct 19, 2021
There is a race where `conn.Close()` was called before `conn.CloseWrite()`.
In this case `CloseWrite` will fail and an useless error is printed. To
fix this we move the the `CloseWrite()` call to the same goroutine to
remove the race. This ensures that `CloseWrite()` is called before
`Close()` and never afterwards.
Also fixed podman-remote run where the STDIN was never was closed.
This is causing flakes in CI testing.

[NO TESTS NEEDED]

Fixes containers#11856

Signed-off-by: Paul Holzinger <[email protected]>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants