Skip to content
Snippets Groups Projects
Commit ecdf3c53 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

iproto: always reload URIs on reconfiguration

Even if the new value of box.cfg.listen is the same as the old one, we
still need to recreate evio service entries' IO stream contexts from the
URIs on reconfiguration, because a URI parameter may store a path to a
file (for example, an SSL certificate), which could change.

Note that we have to rework the way how IO stream contexts are handled
on evio_service_attach. Before this patch, we copied struct iostream_ctx
directly from the source service to the attached service. It was fine,
because (a) we didn't destroy iostream_ctx on detach (we only cleared
it) and (b) we detached IPROTO threads' services from tx_binary before
stopping tx_binary. Now, to reload URIs, we first call the new function
evio_service_reload_uris on tx_binary to recreate iostream_ctx, and only
then reattach IPROTO threads' services, which opens a window for an
IPROTO thread's service to access a destroyed iostream_ctx context while
accepting a new connection. To avoid that, we now copy iostream_ctx to
attached services with the new function iostream_ctx_copy. This function
copies the underlying SSL_CTX with a stub function ssl_iostream_ctx_dup,
which will be implemented in the EE repository using SSL_CTX_up_ref
(i.e. no actual copying will happen - we'll just increment the internal
SSL_CTX reference counter).

Needed for tarantool/tarantool-ee#432

NO_DOC=ee
NO_TEST=ee
NO_CHANGELOG=ee
parent 655290aa
No related branches found
No related tags found
No related merge requests found
Loading
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