Repository navigation
Plugin load fix - #12776
Plugin load fix#12776
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (91.17%) is below the target coverage (92.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #12776 +/- ##
==========================================
- Coverage 87.15% 86.61% -0.54%
==========================================
Files 1484 1486 +2
Lines 100861 102460 +1599
Branches 11524 11519 -5
==========================================
+ Hits 87901 88745 +844
- Misses 12898 13650 +752
- Partials 62 65 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Reviewed the diff — this looks right, and it addresses the root cause rather than the symptom. Confirmed there are no One thing I would raise: That is a narrow regression against today's behaviour, where every process retries on every start. Writing the hash only after a successful install would avoid it: the lease alone is enough to stop concurrent runs, since a process that cannot acquire it skips anyway, and a kill would simply leave the hash unchanged so the next start retries. Minor: I have an instance that reproduces the original bug reliably (Docker, server plus worker, a plugin shipping 29 static files). Happy to run this branch there and report back — it would take re-enabling |
|
Tested this branch on the instance where the original bug reproduces. Method. I could not run master wholesale on a 1.5.2 deployment — master's Result. Five consecutive Verified independently through the API afterwards: all 12 files listed in the plugin's Caveat worth stating: a race is probabilistic, so five clean restarts is a good signal rather than a proof. But the previous behaviour was consistent enough that five failures would have been the expected outcome without the fix. Unrelated finding, while getting the instance into a testable state. My def compare_line(line: str):
return re.match(rf'^{package_reference}[\s=@]', line.strip())For a VCS install |
inventree/InvenTree#12776 replaces the process-local PLUGIN_FILE_HASH with a persisted setting plus a cross-process lease, and makes the static collection stage into a temporary directory before writing to the live destination. It is milestoned 1.6.0 and labelled for backport to 1.5.x, but is not merged yet. Tested on the instance the analysis came from: with both production files patched into the server and worker containers and PLUGIN_ON_STARTUP re-enabled, five consecutive restarts left the plugin's static directory complete and served, where the unpatched code lost it reliably. The README now says to check whether your version already carries the fix before following the workaround, rather than presenting it as unconditional. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
@Kamaar stop posting verbatim AI chat slop into discussion with other humans; these ultra long texts that wonder of in unrelated issues waste everyone’s time |
|
@SchrodingersGat once this is merged I would love to have a point release (I have prepped #12795) as this could explain some hard-to-reproduce deployment issues |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
* Robustify plugin file loading * Lock static file copying * Improve robustness of static file copying * Add regression tests * Handle database not being ready * Fix identified limitation and refactor code * Attempt to fix CI job * instrumentation for CI - will revert * Another bugfix attempt (cherry picked from commit b4cb9a9) Co-authored-by: Oliver <[email protected]>
|
question: how does one auqire a lock if there is no database (during initial setup) |
Addresses concurrency issues related to installing plugins from file, as identified in #12769
Additionally ensures that static file installation (via plugins) is now concurrency safe - preventing partial file updates or file corruption.