Skip to content
Snippets Groups Projects
Commit 0a0731f4 authored by Georgy Kirichenko's avatar Georgy Kirichenko Committed by Roman Tsisyk
Browse files

replication: stop applier writer fiber before reconnect

Writer fiber should be stopped before re-connect to avoid
sending unwanted IPROTO_OK replication acknowledges.

Fixes #2726
parent 382dcae8
No related branches found
No related tags found
No related merge requests found
......@@ -459,14 +459,15 @@ applier_subscribe(struct applier *applier)
static inline void
applier_disconnect(struct applier *applier, enum applier_state state)
{
applier_set_state(applier, state);
if (applier->writer != NULL) {
fiber_cancel(applier->writer);
fiber_join(applier->writer);
applier->writer = NULL;
}
coio_close(loop(), &applier->io);
iobuf_reset(applier->iobuf);
applier_set_state(applier, state);
fiber_gc();
}
......@@ -525,11 +526,11 @@ applier_f(va_list ap)
/* Unrecoverable errors */
applier_log_error(applier, e);
applier_disconnect(applier, APPLIER_STOPPED);
throw;
return -1;
}
} catch (FiberIsCancelled *e) {
applier_disconnect(applier, APPLIER_OFF);
throw;
break;
} catch (SocketError *e) {
applier_log_error(applier, e);
goto reconnect;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment