rabbitmq / osiris

Log based streaming subsystem for RabbitMQ
Other
45 stars 10 forks source link

Handle errors on replica and replica reader #127

Closed dcorbacho closed 1 year ago

dcorbacho commented 1 year ago

The initialisation function of the replica reader expected osiris_writer:init_data_reader/3 to generate an exception, but it returns a tagged error instead. This PR tries to handle better the error so the long badmatch stacktrace is replaced by a log warning and controlled stop.

Also osiris_replica needs to handle the case on terminate when the socked hasn't yet been initialised, otherwise inet_tcp:close/1 returns a function_clause.