Skip to content
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

Use uint64 for parseSize #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hqhq
Copy link

@hqhq hqhq commented Mar 20, 2017

Functions like RAMInBytes offen used to parse memory
set to cgroup, while Linux kernel take cgroup memory
value as uint64, so we need the return value of
RAMInBytes also be uint64, otherwise we are not able
to set memory larger than MAX(int64) and smaller than
MAX(uint64).

This'll somewhat break compatibility since parseSize
returns 0 when input is not parseable, but I doubt
people actually depend on that because we already
return error, so I don't think this'll be a problem.

Signed-off-by: Qiang Huang h.huangqiang@huawei.com

@dnephin
Copy link
Contributor

dnephin commented Mar 20, 2017

Please see #19

Functions like RAMInBytes offen used to parse memory
set to cgroup, while Linux kernel take cgroup memory
value as uint64, so we need the return value of
RAMInBytes also be uint64, otherwise we are not able
to set memory larger than MAX(int64) and smaller than
MAX(uint64).

This'll somewhat break compatibility since parseSize
returns 0 when input is not parseable, but I doubt
people actually depend on that because we already
return error, so I don't think this'll be a problem.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@hqhq hqhq force-pushed the use_uint64_for_parsesize branch from 39486a7 to b7f5cdf Compare March 21, 2017 01:06
@hqhq
Copy link
Author

hqhq commented Mar 21, 2017

@dnephin Thanks for reviewing, I'm aware this'll break backward compatibility, as I said in commit log, I's a real bugfix, the bug impacts Docker and runc and all other projects which are using go-units, and I believe the backward compatibility break is very limited and acceptable.

Even that I noticed go-units is still 0.3.1, usually we don't have to guarantee backward compatibility before 1.0 right?

@thaJeztah
Copy link
Member

thaJeztah commented Aug 4, 2020

@kolyshkin @AkihiroSuda ptal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants