-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set default MemorySwappiness when adapt #18285
Conversation
Tests failures seems related |
b05be86
to
df82400
Compare
@runcom Updated. |
ping @vieux : does this fix the issue you mentioned recently re: memoryswappiness default? |
This is not the first time we've gone through such a change on this field. |
@cpuguy83 What change exactly are you mentioning? I know this field used to be |
Changing the defaults for MemorySwapiness -- just pointing out this has been a problem multiple times. |
I think the default if not provided will default to -1 as it was previously. This patch just move the initialization to -1 back in the code path right @hqhq? |
More correctly, it handles non-Docker clients (e.g. API users like swarm/compose) from causing "unset" to translate to 0, rather than "unset" -> -1, which is what should happen. I think most of the confusion was around catching all the places that instantiation was performed and making sure default != 0, given 0 is a setting, not a default in this case. |
sorry @hqhq ..this needs a rebase now |
Signed-off-by: Qiang Huang <[email protected]>
df82400
to
2f62f9a
Compare
@estesp was right, this PR will fix problem like docker-archive/classicswarm#1411 |
It makes the inspect result consistent between cli and REST api when MemorySwappiness is not set. Signed-off-by: Qiang Huang <[email protected]>
2f62f9a
to
4089b4e
Compare
@hqhq @jimmyxian was this issue introduced in docker 1.9 in Swarm, or already present in docker 1.8.3? Asking so that we can decide if this should be considered for a 1.9.2 release (if we decide to release that) |
@thaJeztah It's exist since Docker v1.5 |
@runcom Yeah, you can see I changed your test cases. You expected API without hostConfig (or just without these fields) has |
@hqhq perfect |
LGTM |
1 similar comment
LGTM |
Set default MemorySwappiness when adapt
I don't believe there is any need for API or user-facing impact--this is really a bug fix for a hole in the setup of containers via certain paths which weren't defaulting properly to the "unset" value (a pointer to -1 in this case), meaning they were getting "default to zero" as a setting for swappiness, which is an actual swappiness value, which of course is a bug unless the user asked for swappiness = 0. |
Thanks for checking @estesp! |
It makes the inspect result consistent between cli and REST api
when MemorySwappiness is not set.
Signed-off-by: Qiang Huang [email protected]