Skip to content
Snippets Groups Projects
Commit 4f72d896 authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

gh-136: move any fiber yield out of catch block.

This is done to avoid situation, when two or more
fibers yield inside their try/catch blocks and
throws an exceptions. Seems like exception unwinder
stores some global state while being inside
a catch block.

This could lead to incorrect exception processing
and server crash.
parent ca531daa
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,7 @@ pull_from_remote(va_list ap)
struct ev_io coio;
struct iobuf *iobuf = NULL;
bool warning_said = false;
int reconnect_sleep = 0;
const int reconnect_delay = 1;
coio_init(&coio);
......@@ -142,7 +143,25 @@ pull_from_remote(va_list ap)
warning_said = true;
}
evio_close(&coio);
reconnect_sleep = 1;
}
/* Put fiber_sleep() out of catch block.
*
* This is done to avoid situation, when two or more
* fibers yield's inside their try/catch blocks and
* throws an exceptions. Seems like exception unwinder
* stores some global state while being inside a catch
* block.
*
* This could lead to incorrect exception processing
* and crash the server.
*
* See: https://github.com/tarantool/tarantool/issues/136
*/
if (reconnect_sleep) {
fiber_sleep(reconnect_delay);
reconnect_sleep = 0;
}
}
}
......
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