You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
YARN-11997. Serialize concurrent Docker image pulls by image name - #8767
JIRA: YARN-11997. Serialize concurrent Docker image pulls by image name
When multiple containers request the same Docker image concurrently, separate NodeManager launch threads can invoke duplicate docker pull commands for that image. These pulls contend on the same image and perform redundant work.
This change serializes pulls by image name with reference-counted per-image locks. Pulls for the same image execute one at a time, while pulls for different images can still run concurrently. Unused locks are removed after the last waiter finishes, including when a pull fails.
Added focused coverage in TestDockerContainerRuntime for serializing concurrent pulls of the same image, allowing different images to pull concurrently, and releasing the image lock after a failed pull.
Hi @brumi1024, could you please take a look when you have time? This change serializes concurrent Docker image pulls by image name while still allowing different images to be pulled in parallel, preventing duplicate pulls and related races in the NodeManager. It includes focused concurrency tests. The patch-side compile, SpotBugs, and unit tests passed; the current overall -1 is caused by an existing SpotBugs warning on trunk. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
JIRA: YARN-11997. Serialize concurrent Docker image pulls by image name
When multiple containers request the same Docker image concurrently, separate NodeManager launch threads can invoke duplicate
docker pullcommands for that image. These pulls contend on the same image and perform redundant work.This change serializes pulls by image name with reference-counted per-image locks. Pulls for the same image execute one at a time, while pulls for different images can still run concurrently. Unused locks are removed after the last waiter finishes, including when a pull fails.
JIRA: https://issues.apache.org/jira/browse/YARN-11997
How was this patch tested?
TestDockerContainerRuntimefor serializing concurrent pulls of the same image, allowing different images to pull concurrently, and releasing the image lock after a failed pull.TestDockerContainerRuntime: 127 tests passed, 0 failures, 0 errors, 0 skipped.git diff --checkpassed.