Project

General

Profile

Bug #43152

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

Added by Nathan Cutler about 4 years ago. Updated almost 3 years 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 (v1):
Crash signature (v2):

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 Dashboard - Feature #44829: mgr/dashboard: Upgrade Angular to v9 Resolved

History

#1 Updated by Nathan Cutler about 4 years ago

#2 Updated by Nathan Cutler about 4 years ago

  • Description updated (diff)

#3 Updated by Kefu Chai about 4 years ago

  • Assignee set to Kefu Chai

#4 Updated by Ernesto Puerta about 4 years 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 almost 4 years ago

#6 Updated by Tiago Melo almost 4 years ago

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

#7 Updated by Tiago Melo over 3 years ago

  • Status changed from New to Resolved

This was fixed in #44829.

#8 Updated by Ernesto Puerta almost 3 years ago

  • Project changed from mgr to Dashboard

Also available in: Atom PDF