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

[protocol] Move close channel after close topics #283

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Jan 12, 2023

Description

unit test exist random crash, isClosed atomic var not use CAS swap and the channel is closed before canceling the topic subscription

panic: send on closed channel

goroutine 2696 [running]:
github.com/dogechain-lab/dogechain/protocol.(*syncPeerClient).handleStatusUpdate(0xc001275680, {0xf98aa0, 0xc0039ef590}, {0xc0039fb440, 0x1484f01})
	/home/runner/work/dogechain/dogechain/protocol/client.go:217 +0x333
github.com/dogechain-lab/dogechain/network.(*topicImp).readLoop.func2()
	/home/runner/work/dogechain/dogechain/network/gossip.go:131 +0x43
created by github.com/dogechain-lab/dogechain/network.(*topicImp).readLoop
	/home/runner/work/dogechain/dogechain/network/gossip.go:124 +0x1b3
FAIL	github.com/dogechain-lab/dogechain/protocol	5.132s

Changes include

  • Bugfix (non-breaking change that solves an issue)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels

Testing

  • I have tested this code with the official test suite

@0xcb9ff9 0xcb9ff9 added the bug fix Functionality that fixes a bug label Jan 12, 2023
@0xcb9ff9 0xcb9ff9 self-assigned this Jan 12, 2023
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for the work.

@DarianShawn DarianShawn merged commit 2c217cb into dogechain-lab:dev Jan 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2023
@0xcb9ff9 0xcb9ff9 deleted the fix/client-channel-close branch January 13, 2023 04:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants