Repository navigation
fix file related race conditions - #6
Merged
Merged
Conversation
The temporary names used as preprocessor output are not unique, so if another generator instance is running, one can be writing into a file while the other is reading it. This usually manifests as an error like `<some_file.idl>:1:0: error: mismatched input '<EOF>' expecting <etc>`. Fix by randomly generating a unique directory, plus being nice and cleaning it up if it is unlikely to be useful. Note that specifying a temporary directory is not actually implemented, despite a flag to do so being listed in the help.
Two generators may be working in the same directory and writing the same dependent file. There is no guarantee that two programs opening the same path and writing into it will produce a coherent result. Fix by writing into a temporary file, then atomically renaming over the destination, so one complete file always exists. This has not been tested on Windows, and may not work right if two generators are intending to write different contents to the file.
Ryanf55
approved these changes
Sep 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please see commits for details.
Tested with the ArduPilot codebase that everything works and is reliable. This should fix the DDS CI.