-
Bug
-
Resolution: Fixed
-
Major
If Run.onLoad takes a little while to run, or generally if RunMap.retrieve is not instantaneous, a race condition can arise. Say thread 1 calls getByNumber for a Run which in fact exists on disk (with a numeric symlink). search will call load(int, null), which will delegate to load(File, null) which acquires the lock; and then blocks for a while in retrieve. Then thread 2 calls getById with the ID of the same build. index.byId is still empty, so it jumps to load(String, null) and then blocks waiting to enter load(File, null). Now thread 1 finishes retrieve, stores the newly loaded Run in the index, and returns. When the lock is released, thread 2 enters it, loads another copy of the same Run, and stores it in the index, clobbering the first entry, and returns that.
Seems to be fixable by making getById double-check the index while holding the lock, forcing it to wait for the first thread to store an entry. (Or could just check under lock whether snapshot != index, and if so, retry.)
Also load(File, null) should assert that there is no current entry for a build before it stores one.
- depends on
-
JENKINS-33219 Job.updateNextBuildNumber can cause deadlock
-
- Open
-
- is duplicated by
-
JENKINS-38509 'java.lang.IllegalStateException: already existed; will not overwite' error for pipeline builds over time
-
- Resolved
-
-
JENKINS-32755 ATH test timeout
-
- Closed
-
- is related to
-
JENKINS-26761 WorkflowJob.getSCMs throws NullPointerException from notifyCommit hooks after Jenkins Restart
-
- Resolved
-
-
JENKINS-27532 WorkflowTest.executorStepRestart failures
-
- Resolved
-
-
JENKINS-24380 Use build numbers as IDs
-
- Resolved
-
- relates to
-
JENKINS-37121 WorkspaceListLeasePickle should help diagnose locked workspaces
-
- Resolved
-
- links to
[JENKINS-22767] AbstractLazyLoadRunMap.getById subject to race condition with .load
Link |
New:
This issue is related to |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Link |
New:
This issue is related to |
Resolution | Original: Duplicate [ 3 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
Status | Original: Reopened [ 4 ] | New: Open [ 1 ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Remote Link | New: This issue links to "PR 1989 (Web Link)" [ 13757 ] |
Labels | Original: lazy-loading threads | New: lazy-loading lts-candidate threads |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Link |
New:
This issue is related to |