hyperledger / firefly

Hyperledger FireFly is the first open source Supernode: a complete stack for enterprises to build and scale secure Web3 applications. The FireFly API for digital assets, data flows, and blockchain transactions makes it radically faster to build production-ready apps on popular chains and protocols.
https://hyperledger.github.io/firefly
Apache License 2.0
507 stars 208 forks source link

fix: do not start multiple blockchain plugin on retry of namespace start #1529

Closed EnriqueL8 closed 5 months ago

EnriqueL8 commented 5 months ago

Fixes https://github.com/hyperledger/firefly/issues/1527

Make sure that in the case where the NS fails to restart because of another plugin has failed do not start the blockchain plugin again when it was successfully started before.

Played around with the idea of using context to clear everything but it didn't make sense. Also I don't think a mutexLock is needed for this.

If you are wondering how all the other plugins work it's because at initialisation part those plugins return a struct that we then use as part of starting the managers/plugins. So we can check for the existence of that struct and not re-initialise that manager/plugin. In the case of the blockchain plugin, it's a shared struct and we just start a new event streams in the init part.