Skip to content

Support submissions across multiple gunicorn workers - #78

Merged
jkalayan merged 3 commits into
mainfrom
77-feature-support-submissions-across-multiple-gunicorn-workers
Oct 16, 2026
Merged

jkalayan merged 3 commits into
mainfrom
77-feature-support-submissions-across-multiple-gunicorn-workers

Conversation

@jkalayan

Copy link
Copy Markdown
Collaborator

Summary

This pull request improves the workflow upload directory handling in a multi-worker environment, ensuring that workflows are consistently accessible across all Gunicorn workers.

Workflow directory management and multi-worker support:

  • Introduced a deterministic directory creation method (_dir_for) in WorkflowStore so that all Gunicorn workers use the same upload directory for a given workflow, replacing the previous random directory approach. This ensures that workflows are accessible regardless of which worker handles the request.
  • Updated the reset and get methods in WorkflowStore to use the deterministic directory, recover workflow state from disk if created by another worker, and synchronize activity timestamps using os.utime to signal liveness across workers.
  • Removed the dependency on make_upload_tmpdir, simplifying directory management and making the process more predictable.

Deployment improvements:

  • Modified the Gunicorn command in the Dockerfile to use the gthread worker class with multiple workers and threads, improving concurrency and ensuring compatibility with the new shared directory approach.

Testing:

  • Added a test suite (tests/test_form/test_workflows.py) to verify workflow directory creation, recovery from disk, error handling for invalid IDs, deletion, and cleanup of expired workflows.

@jkalayan jkalayan self-assigned this Oct 16, 2026
@jkalayan jkalayan added the enhancement New feature or request label Oct 16, 2026
@jkalayan jkalayan linked an issue Oct 16, 2026 that may be closed by this pull request
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38962498713

Coverage increased (+0.9%) to 92.473%

Details

  • Coverage increased (+0.9%) from the base build.
  • Patch coverage: 2 uncovered changes across 1 file (20 of 22 lines covered, 90.91%).
  • 3 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
biosimdb_interface/form/workflows.py 22 20 90.91%

Coverage Regressions

3 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
biosimdb_interface/form/utils.py 3 80.77%

Coverage Stats

Coverage Status
Relevant Lines: 744
Covered Lines: 688
Line Coverage: 92.47%
Coverage Strength: 8.32 hits per line

💛 - Coveralls

@jkalayan
jkalayan merged commit e5b495d into main Oct 16, 2026
12 checks passed
@jkalayan
jkalayan deleted the 77-feature-support-submissions-across-multiple-gunicorn-workers branch October 16, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support submissions across multiple Gunicorn workers

2 participants