system_monitor icon indicating copy to clipboard operation
system_monitor copied to clipboard

Wrong tuple size used in match

Open etnt opened this issue 1 year ago • 1 comments

In the system_monitor:terminate/2 there is a tuple match done with what is stored in State#state.monitors; this looks wrong to me, surely it should match against a 5-element tuple ( {Module,Function,RunOnTerminate, TicksReset, TicksDecremented} ) and not as it is done today (a 4-element tuple).

https://github.com/klarna/system_monitor/blob/1978c2b165514a7be4108f5778a92abf0eff5bc4/src/system_monitor.erl#L129

etnt avatar Dec 21 '23 07:12 etnt

To me it looks like terminate/2 should match 5-tuples as you wrote and apply(Module, Function, []) not apply(?MODULE, Monitor, []). Currently the function is a no-op.

mikpe avatar Dec 21 '23 14:12 mikpe