Skip to content

[FileSystem] Avoid race condition when two scenes try to create config dir in same time#5752

Merged
epernod merged 5 commits intosofa-framework:masterfrom
bakpaul:25_10_avoid_race_condition_when_launching_scene_tests_in_parallel
Nov 14, 2025
Merged

[FileSystem] Avoid race condition when two scenes try to create config dir in same time#5752
epernod merged 5 commits intosofa-framework:masterfrom
bakpaul:25_10_avoid_race_condition_when_launching_scene_tests_in_parallel

Conversation

@bakpaul
Copy link
Contributor

@bakpaul bakpaul commented Oct 28, 2025

Race conditions appeared when we launch scene tests in parallel on ubuntu docker images. Because the folder never exists at the beginning, when launching the scene tests in parallel, all the first scenes launched by workers tried to create it which throwed theses errors:

/workspace/build/external_directories/fetched/BeamAdapter/examples/python3/component/BeamProjectionDifferenceMultiMapping.py: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
/workspace/sofa/examples/Component/Engine/Select/ValuesFromPositions_vectorField.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/SOFAData: File exists
/workspace/sofa/examples/Component/Engine/Transform/TransformPosition.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
/workspace/sofa/examples/Component/MechanicalLoad/InteractionEllipsoidForceField.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
/workspace/sofa/examples/Component/SolidMechanics/Spring/RegularGridSpringForceField.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
/workspace/sofa/examples/Component/Topology/Container/Dynamic/AddingHexa2QuadProcess.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
/workspace/sofa/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping.scn: [ERROR]   [FileSystem::createdirectory()] /home/ci/.config: File exists
[ERROR]   [FileSystem::createdirectory()] /home/ci/.config/SOFA: File exists
[ERROR]   [FileSystem::createdirectory()] /home/ci/SOFAData: File exists

Fortunately (or not), jenkins doesn't count errors but only crashes for scene tests. Which not the case for the new CI, so I need to get this fixed. The fix is simple: if mkdir returns a "file already exists' when trying mkdir, then we're all good, this will only happen in the case of race condition, otherwise mkdir wouldn't have been launched in the first place.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@bakpaul bakpaul added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request pr: status wip Development in the pull-request is still in progress and removed pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request labels Oct 28, 2025
@bakpaul bakpaul added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Oct 30, 2025
@bakpaul
Copy link
Contributor Author

bakpaul commented Oct 30, 2025

[ci-build][with-all-tests]

@hugtalbot hugtalbot added pr: fix Fix a bug pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Nov 6, 2025
@bakpaul bakpaul added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Nov 12, 2025
@bakpaul
Copy link
Contributor Author

bakpaul commented Nov 12, 2025

[ci-build][with-all-tests]

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Nov 13, 2025
@epernod epernod merged commit 0763dec into sofa-framework:master Nov 14, 2025
11 checks passed
@hugtalbot hugtalbot added this to the v25.12 milestone Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants