uchicago-cs / chistributed

8 stars 7 forks source link

Broker's PUB Socket Not Protected by Lock #6

Closed kwzhao closed 6 years ago

kwzhao commented 6 years ago

It looks like do_set(), do_get(), do_send_msg(), etc. can happen concurrently with receive_message(), which is the handler for the broker's ROUTER socket.

All of the above routines call send_message()/__send_zmq_message(), which sends multipart messages out on the broker's PUB socket.

This is tripping assertions in our code; some of our nodes are receiving jumbled multipart messages when SET/GET/send_msg() happen concurrently with custom messages sent between nodes.

When we protect these calls with a lock in the chistributed source, these errors no longer manifest.

borjasotomayor commented 6 years ago

Could you submit a pull request with these additional locks you added to the chistributed source?

kwzhao commented 6 years ago

Done!

borjasotomayor commented 6 years ago

Resolved in #7