In the context of RabbitMQ, if a stream queue is deleted right after being declared, there is a chance that some Osiris processes might not be ready yet at the time the queue is deleted.
In particular, the osiris_replica_reader process monitors the given leader (an osiris_writer process in the context of a RabbitMQ stream queue) during its init/1 and that process might be stopped already.
When this happens, here is the crash that is logged:
That is because the osiris_replica_reader process receives the DOWN message from the leader monitoring with the noproc reason. It reuses the reason for its own exit reason. Because this is an abnormal reason, a crash is being logged.
How
There is no reason to log such a crash when the process tree is being shut down concurrently. osiris_replica_reader can terminate with a normal reason.
That is what this patch does: if the leader exit reason is noproc, it terminates with the normal reason instead.
Why
In the context of RabbitMQ, if a stream queue is deleted right after being declared, there is a chance that some Osiris processes might not be ready yet at the time the queue is deleted.
In particular, the
osiris_replica_reader
process monitors the given leader (anosiris_writer
process in the context of a RabbitMQ stream queue) during itsinit/1
and that process might be stopped already.When this happens, here is the crash that is logged:
That is because the
osiris_replica_reader
process receives theDOWN
message from the leader monitoring with thenoproc
reason. It reuses the reason for its own exit reason. Because this is an abnormal reason, a crash is being logged.How
There is no reason to log such a crash when the process tree is being shut down concurrently.
osiris_replica_reader
can terminate with anormal
reason.That is what this patch does: if the leader exit reason is
noproc
, it terminates with thenormal
reason instead.