Project

General

Profile

Bug #43152

mgr/dashboard: race condition causes dashboard frontend build to fail sometimes

Added by Nathan Cutler 7 months ago. Updated 12 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

When running "make-dist" to build the dashboard frontend, there is a variable "MAX_DASHBOARD_PARALLEL_BUILDS" which defaults to "2". This means that, by default, two languages are built in parallel to speed up the build.

(Normally, of course, only the English dashboard frontend is built, so the default parallelism doesn't actually "kick in" - the race condition only happens, potentially, when (1) building more than one language, and (2) MAX_DASHBOARD_PARALLEL_BUILDS > 1)

When the race condition is triggered, we see:

[build:en-US -- -- --prod] > ceph-dashboard@0.0.0 env_build /tmp/tmp.GEfFNXVA8g/src/pybind/mgr/dashboard/frontend
[build:en-US -- -- --prod] > cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts  && node ./environment.build.js
[build:en-US -- -- --prod]
[build:de-DE -- -- --prod]
[build:de-DE -- -- --prod] > ceph-dashboard@0.0.0 env_build /tmp/tmp.GEfFNXVA8g/src/pybind/mgr/dashboard/frontend
[build:de-DE -- -- --prod] > cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts  && node ./environment.build.js
[build:de-DE -- -- --prod]
[build:de-DE -- -- --prod] cp: cannot create regular file 'src/environments/environment.prod.ts': File exists
[build:de-DE -- -- --prod] npm ERR! code ELIFECYCLE
[build:de-DE -- -- --prod] npm ERR! errno 1

The workaround is to set MAX_DASHBOARD_PARALLEL_BUILDS="1" but it would be nice if the race condition itself were fixed.


Related issues

Related to mgr - Feature #44829: mgr/dashboard: Upgrade Angular to v9 Resolved

History

#1 Updated by Nathan Cutler 7 months ago

#2 Updated by Nathan Cutler 7 months ago

  • Description updated (diff)

#3 Updated by Kefu Chai 7 months ago

  • Assignee set to Kefu Chai

#4 Updated by Ernesto Puerta 7 months ago

@Kefu: this happens due to the prebuild hook (build env setting). npm scripts automagically execute pre-post hooks for any script starting with "pre" or "post". I was searching if there was a way to (ad-hoc) disable pre/post hooks, but no luck. I think some kind of file-lock/check before running the prebuild script could fix this. I think the build environment is common to all localizations.

#5 Updated by Tiago Melo 3 months ago

#6 Updated by Tiago Melo 3 months ago

  • Related to Feature #44829: mgr/dashboard: Upgrade Angular to v9 added

#7 Updated by Tiago Melo 12 days ago

  • Status changed from New to Resolved

This was fixed in #44829.

Also available in: Atom PDF