feat(bitswap): synchronous close - #700
Conversation
here specifically it is the two selects on
Yeah :/ it isnt great. possible mitigation? |
|
I think i may have missed a couple conversations, why does it feel like we are abandoning contexts? |
|
as far as perf, realistically, we wont call |
This isn't an abandonment of contexts. It's a shift in responsibilities. Processes are used for many purposes. The following focuses on processes through the lens of managing the life-cycles of large objects. Sub-systems like bitswap and dht make use of private, async workers. To ensure workers terminate when we expect, systems must manage them. Contexts send termination signals from parent to child, but without additional book-keeping, parents cannot know when its child is terminated. Processes are this additional book-keeping. They are WaitGroups in the large, designed to work without manual reference counting. Contexts are useful for maintaining control over long-running function calls. Processes are useful for managing private asynchronous workers. |
|
Ah, gotcha. This LGTM |
|
merged in c114b04 |
Now, bitswap closes synchronously.
I'm not happy with the performance hit. Not happy with the added complexity either.
Added this functionality to try to stop bitswap from sending and receiving data on the network after the core (and the network) closes. This issue isn't fully resolved. After bitswap closes, messages can still enter from the network. That should be addressed in a future PR.