system_monitor
system_monitor copied to clipboard
Wrong tuple size used in match
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
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.