Skip to content

docs: fix lock file deadlock documentation for dynamic plugins cache#5026

Open
Fortune-Ndlovu wants to merge 3 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:fix/update-lock-file-deadlock-docs
Open

docs: fix lock file deadlock documentation for dynamic plugins cache#5026
Fortune-Ndlovu wants to merge 3 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:fix/update-lock-file-deadlock-docs

Conversation

@Fortune-Ndlovu

Copy link
Copy Markdown
Member

Summary

  • Fix incorrect lock file name in manual cleanup command (dynamic-plugins.lockinstall-dynamic-plugins.lock, matching types.ts#L78)
  • Document the 10-minute lock timeout behavior introduced in the TypeScript rewrite (lock-file.ts#L22)
  • Document CrashLoopBackOff cycle that occurs after timeout with a stale lock
  • Add DYNAMIC_PLUGINS_LOCK_TIMEOUT_MS environment variable documentation
  • Update log message to match current implementation
  • Clarify that lock contention only applies when using a persistent volume

Relates-to: RHDHBUGS-450

Test plan

- Fix wrong lock file name in rm command (RHDHBUGS-450)
- Document 10-min timeout and CrashLoopBackOff behavior
- Add DYNAMIC_PLUGINS_LOCK_TIMEOUT_MS env var
- Clarify lock only applies with persistent volumes
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.77%. Comparing base (a1a8bf9) to head (d0ac248).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5026      +/-   ##
==========================================
- Coverage   55.39%   54.77%   -0.62%     
==========================================
  Files         122      110      -12     
  Lines        2365     2147     -218     
  Branches      562      538      -24     
==========================================
- Hits         1310     1176     -134     
+ Misses       1048      969      -79     
+ Partials        7        2       -5     
Flag Coverage Δ
rhdh 54.77% <ø> (-0.62%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1a8bf9...d0ac248. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Comment thread docs/dynamic-plugins/installing-plugins.md Outdated
Remove incorrect CrashLoopBackOff claim. The exit handler auto-cleans
the stale lock on shutdown so the pod self-heals after one timeout
cycle. Reframe manual rm as optional shortcut. Add note that 1.10.x
and earlier had no timeout (Python script, infinite wait).

Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@Fortune-Ndlovu Fortune-Ndlovu requested a review from rm3l July 1, 2026 17:04
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

The directory where dynamic plugins are located is mounted as a volume to the `install-dynamic-plugins` init container and the `backstage-backend` container. The `install-dynamic-plugins` init container is responsible for downloading and extracting the plugins into this directory. Depending on the deployment method, the directory is mounted as an ephemeral or persistent volume. In the latter case, the volume can be shared between several Pods, and the plugins installation script is also responsible for downloading and extracting the plugins only once, avoiding conflicts.

**Important Note:** If `install-dynamic-plugins` init container was killed with SIGKILL signal, which may happen due to the following reasons:
**Important Note:** When the `dynamic-plugins-root` directory is backed by a persistent volume, the `install-dynamic-plugins` init container uses a lock file (`/dynamic-plugins-root/install-dynamic-plugins.lock`) to prevent concurrent plugin installations across Pods that share the same volume. The lock is acquired before installation begins and released when it completes (or fails).

@rm3l rm3l Jul 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When the dynamic-plugins-root directory is backed by a persistent volume, the install-dynamic-plugins init container uses a lock file

Might be a bit misleading, as the lock file is always checked/created when the install-dynamic-plugins init container starts, regardless of the volume type. Only the contention scenario (another pod holding the lock or a pod that was SIGKILL'ed and reusing the volume) requires a persistent volume.

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.

2 participants