Skip to content

Conversation

@jebonfig
Copy link
Contributor

No description provided.

…s possible if config is overriden via admin API and merged in with viper nested setter syntax

Signed-off-by: jebonfig <joe.bonfiglio@kaleido.io>
…connection needs to be closed when event stream loop terminates to prevent the dangling connection consuming events

Signed-off-by: jebonfig <joe.bonfiglio@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2021

Codecov Report

Merging #367 (e878840) into main (7065837) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #367   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          239       239           
  Lines        12888     12890    +2     
=========================================
+ Hits         12888     12890    +2     
Impacted Files Coverage Δ
internal/blockchain/ethereum/ethereum.go 100.00% <100.00%> (ø)
internal/blockchain/fabric/fabric.go 100.00% <100.00%> (ø)
internal/config/config.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7065837...e878840. Read the comment docs.


func (e *Ethereum) eventLoop() {
defer close(e.closed)
defer e.wsconn.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me. I'm now wondering what is the purpose of close(e.closed) on the line above this? Perhaps that's a @peterbroadhurst question?

Also, I assume we need this same fix in the Fabric plugin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e.closed is to account for Unit Tests waiting for the event loop to end before exiting, which is important otherwise you can get spill-over of execution after the end of tests, calling mocks after they are cancelled.

It does feel like the e.wsconn.Close() should come before the close(e.closed) to me (think the risk of spurious UT failures is low, but I couldn't rule them out)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I assume we need this same fix in the Fabric plugin?

Agreed. Think we should get the close into both - sorry it's missing, surprised at that and how it hasn't caused problems before 🤷

Signed-off-by: jebonfig <joe.bonfiglio@kaleido.io>
@awrichar awrichar merged commit 35c79bf into hyperledger:main Dec 29, 2021
@awrichar awrichar deleted the map-config-overrides branch December 29, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants