Skip to content
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

fix: running parallel bundle submits no longer clobbers config file #444

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

ddneilson
Copy link
Contributor

@ddneilson ddneilson commented Sep 10, 2024

Fixes: #386

What was the problem/requirement? (What/Why)

The customer reports that the config file can get clobbered when running many bundle submit commands in parallel. When clobbered, the config file will only contain the job-id for the a submitted job; all of the farm, queue, etc information will be gone.

What was the solution? (How)

A standard pattern for concurrent file modification is to write changes to a temp file, and then move that temp file overtop of the config file via a filesystem rename operation. The rename is atomic, so that prevents the file content from being clobbered.

What is the impact of this change?

How was this change tested?

The unit tests already covered all required cases. Importantly, there are already tests that verify that the file permissions of the config file is correctly set, and those still pass.

Was this change documented?

None required.

Is this a breaking change?

No. No public interfaces change.

Does this change impact security?

Yes, this does impact security as it affects how the configuration file is created. However, tests already exist to ensure that the files are created with the correct permissions, and those pass just fine.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ddneilson ddneilson added the security Pull requests that could impact security label Sep 10, 2024
Fixes: aws-deadline#386

Problem:

The customer reports that the config file can get clobbered when running
many bundle submit commands in parallel. When clobbered, the config file
will only contain the job-id for the a submitted job; all of the farm, queue, etc
information will be gone.

Solution:

A standard pattern for concurrent file modification is to write changes to a temp file,
and then move that temp file overtop of the config file via a filesystem rename operation.
The rename is atomic, so that prevents the file content from being clobbered.

Signed-off-by: Daniel Neilson <[email protected]>
Copy link

@ddneilson ddneilson marked this pull request as ready for review September 10, 2024 18:31
@ddneilson ddneilson requested a review from a team as a code owner September 10, 2024 18:31
@ddneilson ddneilson merged commit 609e027 into aws-deadline:mainline Sep 10, 2024
18 checks passed
@ddneilson ddneilson deleted the fix_386 branch September 10, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Pull requests that could impact security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Deadline Config File Issue on Bundle Submission
3 participants