protoactor-go
protoactor-go copied to clipboard
Potential memory leak
child_restart_stats.go if not reached the condition to reset, the length of failureTimes will keep growing

I am not sure what is what you mean but is not even possible that there is a memory leak in the piece of code that you just pasted, this is a simple loop, even if the condition was never reach the only thing that would happen to num is that it would overflow, and if that ever happened, you have bigger problems as this would dead lock forever
maybe I should pasted this piece of code. if condition is never reached, the reset will never be called. but the function rs.Fail lead the growth of rs.failureTimes.

It's my advice.

I'm from China and my English is not very well. Thanks for your attention.
I am not sure what is what you mean but is not even possible that there is a memory leak in the piece of code that you just pasted, this is a simple loop, even if the condition was never reach the only thing that would happen to
numis that it would overflow, and if that ever happened, you have bigger problems as this would dead lock forever
Can you see my reply?
@xiaoqinguo Hello. You mean Fail or NumberOfFailures will causing memory leak?
Maybe a Example to reproduce it will be clearly. 😃
https://github.com/asynkron/protoactor-go/blob/d2ceff064d72ca58a9365439827375024ba69c85/actor/child_restart_stats.go#L33-L48
https://github.com/asynkron/protoactor-go/blob/d2ceff064d72ca58a9365439827375024ba69c85/actor/child_restart_stats.go#L23-L25
@cupen 上次是把代码全部看了一遍,这个问题确实是看代码发现的问题,不过问题并不大,也不一定能测出来,但逻辑上看确实会存在泄露