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
LinkCreatesNamedFile test failure #23821
Comments
What sort of environment is it that exhibits this failure? (Thinking maybe an NTFS filesystem on Linux?) I would suggest this could be fixed by having the fallback behavior create a named temporary file (unfortunately), keeping track of that file in the AsyncFileContext object, moving it in lieu of linkat or deleting it during close. It should maybe be a distinct AsyncFileContext (though perhaps a subclass of AsyncFileContextThreadPool) since the more common case works without that information. That variant could also potentially make this able to function in Windows. (Unfortunate because it could potentially make for inconsistent behavior with any code that looks at directory contents, and it will leave a mess behind if a crash occurs while the file exists, like the regular variant does not.) |
The env is a docker container running in a k8s cluster probably running in an old kernel. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
I have a plan to address this, involving migrating |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
Still working on it, bot! |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
Still in my queue, not stale! |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
This test is consistently failing in my environment:
envoy/test/extensions/common/async_files/async_file_handle_thread_pool_test.cc
Line 140 in 35bf11a
Here's my attempt to explain why:
The function
manager_->createAnonymousFile()
relies on the underlying filesystem supporting theO_TMPFILE
flag:envoy/source/extensions/common/async_files/async_file_manager_thread_pool.cc
Line 135 in 35bf11a
The fallback code (a few lines below) creates a file and deletes it, without closing it, returning its file descriptor. I'm reaching this fallback code, because my filesystem doesn't support the
O_TMPFILE
flag.The problem happens when a hard link is created later with
linkat()
:envoy/source/extensions/common/async_files/async_file_context_thread_pool.cc
Line 49 in 35bf11a
It fails with ENOENT, as stated in the manual page:
As seen here: https://man7.org/linux/man-pages/man2/link.2.html
cc @ravenblackx
The text was updated successfully, but these errors were encountered: