Handle :EXIT messages in ingestion WriteBuffer#6454
Conversation
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
|
Thanks for your contribution. With regards to the test, it seems a bit pointless to send a message to an artificially spawned buffer - you could do that against the primary buffer as well, since nothing is expected to happen - except no crash. You could experiment with triggering sending the actual But the PR states that this is ClickHouse socket dying - in which case |
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
|
Good points, thanks. I reworked the test to spawn a process, link it to the buffer, and kill it, so the buffer now receives a genuine On the second point: you're right that the socket dying is a separate failure mode. The buffer isn't linked to the ClickHouse connection ( |
Changes
Plausible.Ingestion.WriteBuffercallsProcess.flag(:trap_exit, true)soterminate/2can flush the buffer on shutdown, buthandle_info/2only matched:tick. When a linked port or process (the ClickHouse connection socket) exits, the GenServer receives{:EXIT, port, :normal}and crashes with aFunctionClauseError, then restarts. This adds ahandle_info/2clause that ignores:EXITmessages so the buffer keeps running. Fixes #6382.