File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,5 +103,11 @@ class FileBufferManager(BaseBufferManager):
103103 _buffers = {}
104104
105105 def get_buffer_for_node (self , node_id , receptor ):
106- path = os .path .join (os .path .expanduser (receptor .config .default_data_dir ))
107- return self ._buffers .setdefault (node_id , DurableBuffer (path , node_id , asyncio .get_event_loop ()))
106+ # due to the way that the manager is constructed, we won't have enough
107+ # information to build a proper defaultdict at the time, and we want to
108+ # make sure we only construct a single instance of DurableBuffer
109+ # per-node so.. doing this the hard way.
110+ if node_id not in self ._buffers :
111+ path = os .path .join (os .path .expanduser (receptor .config .default_data_dir ))
112+ self ._buffers [node_id ] = DurableBuffer (path , node_id , asyncio .get_event_loop ())
113+ return self ._buffers [node_id ]
You can’t perform that action at this time.
0 commit comments