Skip to content

Avoid parallel action conflicts - #112

Merged
DavidePrincipi merged 2 commits into
mainfrom
feat-7544-5
Sep 29, 2025
Merged

DavidePrincipi merged 2 commits into
mainfrom
feat-7544-5

Conversation

@DavidePrincipi

Copy link
Copy Markdown
Member

This PR protects certificate actions from conflicts during parallel runs.

  • set-route: parallel calls are allowed
  • set-certificate: parallel calls are serialized by a lock file

Refs NethServer/dev#7544

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements serialization of certificate operations to prevent conflicts during parallel execution. The main focus is on protecting certificate actions that could interfere with each other when running simultaneously.

  • Added file locking mechanism for default certificate operations to ensure sequential execution
  • Implemented unique configuration file naming to prevent conflicts during certificate validation
  • Added cleanup mechanisms for temporary files created during validation processes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread imageroot/pypkg/cert_helpers.py Resolved
Comment thread imageroot/pypkg/cert_helpers.py Resolved
Comment thread imageroot/pypkg/cert_helpers.py Resolved
@DavidePrincipi
DavidePrincipi force-pushed the feat-7544-5 branch 2 times, most recently from 4fa7ea9 to 8609ac7 Compare September 29, 2025 10:48
Create separate Traefik router config files, to avoid concurrency with
parallel set-route action runs.
Use a process-wide lockfile to prevent conflict on new default cert
generation. To start a request we modify the _default_cert.yml file and
until it completes no other action run can access it.

This commit protects the request_new_default_certificate() function with
a process-wide lock file, that is released when the calling process
terminates.
@DavidePrincipi
DavidePrincipi merged commit c8e78ca into main Sep 29, 2025
@DavidePrincipi
DavidePrincipi deleted the feat-7544-5 branch September 29, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants