adaptation: avoid holding lock across runtime update callback - #301
Merged
Conversation
ningmingxiao
force-pushed
the
fix_deadlock
branch
2 times, most recently
from
July 10, 2026 10:17
342385d to
1ac0953
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to address the deadlock reported in containerd/containerd#13733 by adjusting lock behavior in the NRI runtime adaptation, introducing an optional external mutex intended to control lock ordering between the runtime and the adaptation layer.
Changes:
- Added
adaptMutoAdaptationand a new optionWithAdaptLockto configure an external mutex. - Updated
updateContainersto acquire the optional external mutex before acquiring the internalAdaptationmutex.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ningmingxiao
force-pushed
the
fix_deadlock
branch
from
July 15, 2026 02:29
1ac0953 to
885a390
Compare
Member
|
@ningmingxiao could you please update the git commit message with new title and this information? Thanks |
ningmingxiao
force-pushed
the
fix_deadlock
branch
from
July 17, 2026 00:16
885a390 to
3b1c19a
Compare
Contributor
Author
|
@fuweid done thanks |
ningmingxiao
force-pushed
the
fix_deadlock
branch
3 times, most recently
from
July 17, 2026 00:43
a9aabad to
39a71d5
Compare
updateContainers currently holds the Adaptation mutex while calling the runtime-provided updateFn. containerd's updateFn acquires its local NRI mutex, while CRI lifecycle paths acquire the same locks in the opposite order: lifecycle: local mutex -> Adaptation mutex update: Adaptation mutex -> local mutex Concurrent lifecycle and plugin-initiated update requests can therefore deadlock. updateContainers does not access mutable Adaptation state. Invoke updateFn without holding the Adaptation mutex and leave synchronization of runtime-owned state to the runtime. Fixes containerd/containerd#13733 Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
ningmingxiao
force-pushed
the
fix_deadlock
branch
from
July 17, 2026 05:51
39a71d5 to
55afaa2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix containerd/containerd#13733