Skip to content

fix(test): avoid AF_UNIX socket-file hang in temp_socket_dir teardown#262

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/fix-afunix-socket-dir-cleanup-hang
Jun 1, 2026
Merged

fix(test): avoid AF_UNIX socket-file hang in temp_socket_dir teardown#262
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/fix-afunix-socket-dir-cleanup-hang

Conversation

@sgerbino
Copy link
Copy Markdown
Collaborator

@sgerbino sgerbino commented Jun 1, 2026

temp_socket_dir's destructor used std::filesystem::remove_all() on a directory holding a bound AF_UNIX socket file. remove_all() stats each entry via symlink_status(), which on Windows libstdc++ opens the file with CreateFileW; opening an AF_UNIX socket file hangs in ZwCreateFile, deadlocking teardown. This timed out the MinGW gcov coverage build (1500s) in local_stream_socket.iocp, native.local_stream_socket.iocp and wait.iocp -- the only suites that bind AF_UNIX paths. MSVC STL stats without opening the file, so the regular CI and non-coverage builds were unaffected; the wait-reactor WSAPoll change in ca33581 addressed an unrelated subsystem (the hang is in test teardown).

Unlink the socket file with std::remove (deletes by name without opening it) before remove_all walks the now-empty directory. Portable, no platform branch.

temp_socket_dir's destructor used std::filesystem::remove_all() on a
directory holding a bound AF_UNIX socket file. remove_all() stats each
entry via symlink_status(), which on Windows libstdc++ opens the file
with CreateFileW; opening an AF_UNIX socket file hangs in ZwCreateFile,
deadlocking teardown. This timed out the MinGW gcov coverage build
(1500s) in local_stream_socket.iocp, native.local_stream_socket.iocp
and wait.iocp -- the only suites that bind AF_UNIX paths. MSVC STL
stats without opening the file, so the regular CI and non-coverage
builds were unaffected; the wait-reactor WSAPoll change in ca33581
addressed an unrelated subsystem (the hang is in test teardown).

Unlink the socket file with std::remove (deletes by name without
opening it) before remove_all walks the now-empty directory. Portable,
no platform branch.
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://262.corosio.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-06-01 15:48:57 UTC

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.77%. Comparing base (ca33581) to head (52a9085).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #262   +/-   ##
========================================
  Coverage    77.77%   77.77%           
========================================
  Files           96       96           
  Lines         7262     7262           
  Branches      1773     1773           
========================================
  Hits          5648     5648           
  Misses        1104     1104           
  Partials       510      510           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca33581...52a9085. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cppalliance-bot
Copy link
Copy Markdown

GCOVR code coverage report https://262.corosio.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://262.corosio.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://262.corosio.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-06-01 16:00:29 UTC

@sgerbino sgerbino merged commit e99c20c into cppalliance:develop Jun 1, 2026
41 checks passed
@sgerbino sgerbino deleted the pr/fix-afunix-socket-dir-cleanup-hang branch June 1, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants