dedis / onet

Overlay Network for distributed protocols
GNU Lesser General Public License v3.0
50 stars 29 forks source link

Updates the processor to close all potential stop chans #674

Closed nkcr closed 3 years ago

nkcr commented 3 years ago

Some streaming services, like the pagination one, use a different stop chan for each call, but the actual implementation would only close the last one, which would lead to go routine leaks.

Cancels https://github.com/dedis/cothority/pull/2437

@ineiti @tharvik: that is related to https://github.com/dedis/cothority/pull/2437. Based on your comments Linus I think the problem should be solved by onet, as I originally did but finally went with the cothority PR. The pagination service should be completely stateless, and onet should ensure it closes all the stop channels.

nkcr commented 3 years ago

@ineiti sonar cloud makes it fail for no reason. The PR is ready otherwise.

nkcr commented 3 years ago

Tried for a while the solution proposed by @ineiti but without success. I would be happy to discuss more about the best way to refactor the ProcessClientStreamRequest function, but let's do it on another PR. I made the update to close the channel when a premature return occurs.

sonarcloud[bot] commented 3 years ago

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
27.0% 27.0% Duplication

ineiti commented 3 years ago

For further discussion, see #675