Skip to content

Lock the PID file when creating or deleting it#12232

Merged
StpMax merged 2 commits into
releases/26.1.0from
fix/FQE-1878
Feb 26, 2026
Merged

Lock the PID file when creating or deleting it#12232
StpMax merged 2 commits into
releases/26.1.0from
fix/FQE-1878

Conversation

@StpMax
Copy link
Copy Markdown
Collaborator

@StpMax StpMax commented Feb 18, 2026

Description

Lock PID file to prevent race-condition issues, like:
ProcessA: pid_file.exists() → False
ProcessB: pid_file.exists() → False
ProcessA: write to pid file
ProcessB: write to pid file → Error

Fixes #FQE-1878

Type of change

(Please delete options that are not relevant)

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ⚡ New feature (non-breaking change which adds functionality)
  • 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • 📄 This change requires a documentation update

Verification Process

To ensure the changes are working as expected:

  • Test Location: Specify the URL or path for testing.
  • Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

Additional Media:

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

@StpMax StpMax requested a review from ea-rus February 18, 2026 15:37
Comment thread mindsdb/utilities/fs.py
except Exception:
pass
logger.warning(f"Found existing PID file {pid_file} but it is not a valid JSON, removing")
lock_file = p.joinpath("pid.lock")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe to lock pid file instead?

@StpMax StpMax merged commit e6c5498 into releases/26.1.0 Feb 26, 2026
54 of 63 checks passed
@StpMax StpMax deleted the fix/FQE-1878 branch February 26, 2026 16:12
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants