jenkins-bot has submitted this change and it was merged.

Change subject: mw-install-sqlite: avoid race condition
......................................................................


mw-install-sqlite: avoid race condition

By using $JOB_NAME, jobs run in parallel might well end up deleting the
tmpfs sqlite database from another run of the same job.  Instead use the
trailing part of the WORKSPACE for which Jenkins append @1, @2 as a
suffix.

Change-Id: I0ec838647d76f75da555b555977e56bfaa349485
---
M bin/mw-install-sqlite.sh
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/mw-install-sqlite.sh b/bin/mw-install-sqlite.sh
index 18ae586..24319af 100755
--- a/bin/mw-install-sqlite.sh
+++ b/bin/mw-install-sqlite.sh
@@ -2,7 +2,11 @@
 
 # We sometime have a tmpfs to use, that speeds up sqlite
 if [ -d "$HOME/tmpfs" ]; then
-       SQLITE_DIR="$HOME/tmpfs/$JOB_NAME"
+       # We can not use JOB_NAME has a job identifier since when running in
+       # parallel we will have a race condition. Instead use the trailing part 
of
+       # the WORKSPACE which would be 'foo', 'foo@1', 'foo@2'
+       # Trailing slash is important there.
+       SQLITE_DIR="$HOME/tmpfs/`basename $WORKSPACE`/"
        mkdir -p $SQLITE_DIR
 else
        SQLITE_DIR="$WORKSPACE/data"

-- 
To view, visit https://gerrit.wikimedia.org/r/90047
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ec838647d76f75da555b555977e56bfaa349485
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to