-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stopping maltcp_ctx is unreliable #3
Comments
I agree with your analysis in the way to stop correctly a zloop. However, as all transports are not based on a zloop, the code that sends the dedicated message must be located in the _ctx_stop method (maltcp and malzmq) rather than in mal_ctx_stop. |
Of course, I would just mean that, as a user we use |
Normally the context closing has been improved and the zloop is stopped correctly. |
I still encounter SEGFAULT at test termination, at random. For example,
|
I believe this issue should be re-opened. Stopping maltcp_ctx on my end does something with the endpoints which prevents my application from receiving responses messages to my request operation after I start maltcp_ctx again. As a workaround I am completely destroying and recreating the consumer object for each request, which is a bit overkill. I would have liked to have re-used the same listening socket connection. |
Reading the MALC API, it seems that the operation to interrupt the
mal_ctx_start()
ismal_ctx_stop()
. But, this call gives an unpredictable behaviour: the unit tests provided by malc stop cleanly, while our implementation (using two separate processes, one for the provider and another for the consumer) have a behaviour depending on the number of CPU.Reading the code, we understand that
mal_ctx_stop()
destroy the zloop, but do not stop it. Reading czmq zloop's test (Cf. https://github.com/zeromq/czmq/blob/master/src/zloop.c#L876) the right way to stop the zloop is to have an event handler returning '-1'.If our understanding is correct, we think that malc should be improved in the following way:
mal_ctx_stop()
inmal_ctx_destroy()
ctrl_socket
?) in the maltcp_ctxmal_ctx_stop()
sending a dedicated message ($TERM
?) in thectrl_socket
Do you agree this understanding?
The text was updated successfully, but these errors were encountered: