Code review comment for ~cgrabowski/maas:fix_connections_dict_update_while_updating_connection_count

Revision history for this message
Björn Tillenius (bjornt) wrote :

A lock would be one solution, but with Twisted there's another approach. You can basically move the copy of the dict to outside of of _update() and pass it to deferToDatabase(). That way you get an automatic lock for the connections dict, since both the copy and the modifications run in the main thread.

« Back to merge proposal