Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] fix inflightRequestLock deadlock in tcp/udp tracing #60

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

FyZhu97
Copy link

@FyZhu97 FyZhu97 commented Jul 15, 2024

take ipv4 tcp tracer as an example:
In tracer/tcp_ipv4, TCPTracer.send() make a channel without buffer which is used to receive the result hop.
image

However, when send() is timeout, the func returns. So there will be no receivers to receive the channel, which causes the channel blocked forever.
image
The result hop sended to the channel after timeout will block forever too. And the inflightRequestLock never unlocks, causing all the send() goroutines blocked forever and the waitgroup will never done. Then, deadlock.
image
The same thing occurs in ipv6 tcp and udp tracer too.

This bugfix makes the channel with 1 buffer, which can avoid the send block.

@tsosunchia
Copy link
Member

well done

@tsosunchia tsosunchia merged commit 849cf48 into nxtrace:main Jul 15, 2024
36 checks passed
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.

2 participants