Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[python-pcp] Fix a bug in pmsubsys which causes timestamp to reset. #31

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

marcliangma8 commented Jul 16, 2015

Problem:
pmFreeResult is used to free memory allocated by metric_result. However, it will corrupt memory and reset self._timestamp for diff calculation. So, all subsequent collections will have huge aggregated values instead of rate between intervals.

Fix:
Use copy.deepcopy to assign values for _timestamp which will survive from pmFreeResult call.

Hi Marc,

marcliangma8 notifications@github.com writes:

Problem:
pmFreeResult is used to free memory allocated by metric_result.
However, it will corrupt memory and reset self._timestamp for diff
calculation. So, all subsequent collections will have huge aggregated
values instead of rate between intervals.

Fix:
Use copy.deepcopy to assign values for _timestamp which will survive
from pmFreeResult call.

Thanks for posting this. The patch looks sound to me, and fixes the issue
on the boxes I've tested it on. I'll try and add some qa later this
week.

Cheers,

Lukas

Contributor

natoscott commented Nov 18, 2015

This fix was merged awhile back, not sure why its still showing as open.

@natoscott natoscott closed this Nov 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment