flatcar-linux-update-operator icon indicating copy to clipboard operation
flatcar-linux-update-operator copied to clipboard

pkg/updateengine: ReceiveStatuses() may get nil signal on shutdown and panic

Open invidian opened this issue 4 years ago • 2 comments

Originally reported here: https://github.com/coreos/bugs/issues/1987

However, https://github.com/coreos/locksmith/pull/137/commits/8b0a62ef420c80cee39c3de77daeb7bf7c5bf81c doesn't seem like a correct fix for it, as you can avoid getting nil signal completely, if you wait for receiver loop to shut down, e.g. by waiting for the final nil value from given ch on the process spawning ReceiveStatuses() goroutine.

Also related: https://github.com/godbus/dbus/issues/271

invidian avatar Nov 24 '21 01:11 invidian

Actually, this does not affect agent, as it always drains the receive channel, but it's important to notice when consuming pkg/updateengine directly, so we should have unit tests for this.

invidian avatar Nov 24 '21 01:11 invidian

This also happens when you close the client before stopping the receiver routine, so clearly a bug.

invidian avatar Nov 24 '21 18:11 invidian