Fix use of try_lock and lock methods to explicitly use AdvisoryFileLock trait implementation for std::fs::File in core_dump_handler #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the usage of the try_lock/lock method in the core_dump_composer and core_dump_agent modules of the core-dump-handler project.
Specifically, it enforces the use of the try_lock/lock implementation from the AdvisoryFileLock trait provided by the advisory-lock crate for the std::fs::File type.
This change is necessary to prevent compilation errors on Rust versions 1.89.0 and above, where the compiler tries to call the try_lock/lock method directly from the standard library's std::fs::File instead of from the advisory-lock crate.
With this fix, the code explicitly scopes the try_lock/lock call to AdvisoryFileLock, ensuring compatibility with newer Rust versions and avoiding ambiguous method call errors.
The fix improves stability and future-proofing of the file locking mechanism in core-dump-handler.