Summary: | (Bug 35428 follow-up) po files (sometimes) fail to update | ||
---|---|---|---|
Product: | Koha | Reporter: | Janusz Kaczmarek <januszop> |
Component: | translate.koha-community.org | Assignee: | Janusz Kaczmarek <januszop> |
Status: | Pushed to oldstable --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, lucas |
Version: | unspecified | Keywords: | rel_23_05_candidate, rel_23_11_candidate |
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
24.05.00,23.11.06,23.05.12
|
Circulation function: | |
Bug Depends on: | 35428 | ||
Bug Blocks: | |||
Attachments: |
Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update
Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update |
Description
Janusz Kaczmarek
2024-04-30 10:16:49 UTC
Created attachment 165836 [details] [review] Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update Under some circumstances (e.g. non-standard disk latency) po files fail to be generated. The output from the gulp po:update --lang xx-XX task is than like this: [10:01:39] 'po_update_staff' errored after 6.41 s [10:01:39] Error: ENOENT: no such file or directory, open '/tmp/koha-5WCc9s/Koha-staff-prog.pot' This is due to the time dependencies inside the function flush (callback) (in the function xgettext) in gulpfile.js. It happens that the /tmp/koha-NNNNNN folder gets deleted before the asynchronous callback function called by fs.readFile is completed. The callback should copy the content of the .pot file from /tmp/koha- to its final destination, while, in parallel in fact, the folder inside /tmp is being removed. This creates a race condition. Test plan: ========== Hard to reproduce. But the race condition found in the code should be obvious. Awesome, thanks! Created attachment 166242 [details] [review] Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update Under some circumstances (e.g. non-standard disk latency) po files fail to be generated. The output from the gulp po:update --lang xx-XX task is than like this: [10:01:39] 'po_update_staff' errored after 6.41 s [10:01:39] Error: ENOENT: no such file or directory, open '/tmp/koha-5WCc9s/Koha-staff-prog.pot' This is due to the time dependencies inside the function flush (callback) (in the function xgettext) in gulpfile.js. It happens that the /tmp/koha-NNNNNN folder gets deleted before the asynchronous callback function called by fs.readFile is completed. The callback should copy the content of the .pot file from /tmp/koha- to its final destination, while, in parallel in fact, the folder inside /tmp is being removed. This creates a race condition. Test plan: ========== Hard to reproduce. But the race condition found in the code should be obvious. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed for 24.05! Well done everyone, thank you! Pushed to 23.11.x for 23.11.06 Backported to 23.05.x for upcoming 23.05.12 |