Repository navigation
adaptation: fix silently dropped plugin pids limit updates - #339
Merged
Merged
Conversation
adaptation: fix silently dropped plugin pids limit updates updateResources() merges each resource field of a plugin's ContainerUpdate into a copy of the container's current resources and writes the merged copy back to both the request and the reply. Every field takes its new value from the plugin's update, u.Linux.Resources, except the pids limit. That block was copied from the create-path adjustResources(), where the variable of the same name holds the plugin's resources, so in updateResources() it ended up reading the merged copy instead of the update. Consequently: - if the update request carried no pids limit, the block was skipped entirely: the plugin's pids limit was silently dropped, no ownership of the field was recorded, and two plugins setting the same limit went undetected instead of conflicting, while - if the request carried one, the old value was silently kept, the plugin was still recorded as the owner, and any other plugin touching the pids limit then failed the whole request with a spurious conflict error. Read the pids limit from the plugin's update, like all the other fields, and add regression tests covering pids limit updates relayed via UpdateContainer, the Update section of CreateContainer responses, and the conflict when two plugins set the pids limit. Signed-off-by: pandaWall <mangosteen922@126.com>
klihub
approved these changes
Oct 29, 2026
klihub
left a comment
Member
There was a problem hiding this comment.
Thank you for spotting and fixing this. LTGM.
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.
adaptation: fix silently dropped plugin pids limit updates
updateResources() merges each resource field of a plugin's ContainerUpdate into a copy of the container's current resources and writes the merged copy back to both the request and the reply. Every field takes its new value from the plugin's update, u.Linux.Resources, except the pids limit. That block was copied from the create-path adjustResources(), where the variable of the same name holds the plugin's resources, so in updateResources() it ended up reading the merged copy instead of the update. Consequently:
if the update request carried no pids limit, the block was skipped entirely: the plugin's pids limit was silently dropped, no ownership of the field was recorded, and two plugins setting the same limit went undetected instead of conflicting, while
if the request carried one, the old value was silently kept, the plugin was still recorded as the owner, and any other plugin touching the pids limit then failed the whole request with a spurious conflict error.
Read the pids limit from the plugin's update, like all the other fields, and add regression tests covering pids limit updates relayed via UpdateContainer, the Update section of CreateContainer responses, and the conflict when two plugins set the pids limit.