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.
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 longbadmatch
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, otherwiseinet_tcp:close/1
returns afunction_clause
.