celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

node: host is not closed if it was passed via option

Open vgonkivs opened this issue 3 years ago • 2 comments

We are replacing libp2p.Host in case of passing it through the option so it is not closed properly by lifecycle when node stops.

vgonkivs avatar Jul 11 '22 10:07 vgonkivs

There is a question here that needs to be answered. Who is responsible for the lifecycle of a dependency given as an option?

Managing it ourselves is less error-prone for our code while it might cause problems for the user. However, though, if probably documented, the user will be glad to do do less work, delegating lifecycling to us, while we have better control.

The soon-to-be-released FX feature to add lifycling through annotations will facilitate the fix here.

Wondertan avatar Jul 12 '22 19:07 Wondertan

Ref: https://github.com/celestiaorg/celestia-node/issues/923

Bidon15 avatar Aug 09 '22 13:08 Bidon15

This can be closed

renaynay avatar Aug 11 '23 09:08 renaynay

I am not sure we resolved it. The lyfecycling for provided hosts is not figured out

Wondertan avatar Aug 11 '23 10:08 Wondertan