buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.46k stars 9 forks source link

fix output_ws and output_tcp deadlock #1172

Closed ivan-stankov-salt-security closed 1 year ago

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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
No Duplication information No Duplication information

ivan-stankov-salt-security commented 1 year ago

@buger could you please check the PR ?

buger commented 1 year ago

This is interesting! Any explanation on why you think it was the issue?

DimaGolomozy commented 1 year ago

i guess if the buf is small (or full), if you insert (<-) the msg to the buffer, it may stuck until some thing will consume the buffer. so need to start the worker before

am i correct @ivan-stankov-salt-security ?

ivan-stankov-salt-security commented 1 year ago

This is interesting! Any explanation on why you think it was the issue?

You need to restart the worker first, because if a new message is added before that and the buffer is full it will block for ever when you try to add the message back to the buffer. I have a code which can re-produce the problem. I can share it with you if needed.