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

[control-service]:fix memoryToMB conversion overflow in KubernetesService #462

Merged
merged 4 commits into from
Nov 1, 2021

Conversation

mrMoZ1
Copy link
Contributor

@mrMoZ1 mrMoZ1 commented Oct 29, 2021

why: We noticed in the logs that a running control service
would update a data job execution with a negative value for
memory allocation. As a user I want to know for certain the
allocated memory resources for a data job and a negative
value is an obvious bug.

what: Changed culprit function's implementation to use BigInteger instead
of int as the calculations it was performing would easily overflow the int
value at around 2gb or more.

testing: Added unit tests that verify function is working as intended
on small and large conversion numbers.

Signed-off-by: Momchil Zhivkov [email protected]

Signed-off-by: mrMoZ1 <[email protected]>
@mrMoZ1 mrMoZ1 force-pushed the person/mzhivkov/fix-resource-memory branch from 12efae0 to 5a595db Compare October 29, 2021 15:49
@mivanov1988
Copy link
Collaborator

Good job.

Signed-off-by: mrMoZ1 <[email protected]>
Signed-off-by: mrMoZ1 <[email protected]>
@mrMoZ1 mrMoZ1 merged commit 270eb75 into main Nov 1, 2021
@mrMoZ1 mrMoZ1 deleted the person/mzhivkov/fix-resource-memory branch November 1, 2021 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants