mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
event, p2p/simulations/adapters: use buffered channel to avoid goroutine leak
This commit is contained in:
parent
34bb132b10
commit
da12747636
2 changed files with 2 additions and 2 deletions
|
|
@ -143,7 +143,7 @@ func (s *resubscribeSub) loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *resubscribeSub) subscribe() Subscription {
|
func (s *resubscribeSub) subscribe() Subscription {
|
||||||
subscribed := make(chan error)
|
subscribed := make(chan error, 1)
|
||||||
var sub Subscription
|
var sub Subscription
|
||||||
retry:
|
retry:
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ func (n *ExecNode) Stop() error {
|
||||||
if err := n.Cmd.Process.Signal(syscall.SIGTERM); err != nil {
|
if err := n.Cmd.Process.Signal(syscall.SIGTERM); err != nil {
|
||||||
return n.Cmd.Process.Kill()
|
return n.Cmd.Process.Kill()
|
||||||
}
|
}
|
||||||
waitErr := make(chan error)
|
waitErr := make(chan error, 1)
|
||||||
go func() {
|
go func() {
|
||||||
waitErr <- n.Cmd.Wait()
|
waitErr <- n.Cmd.Wait()
|
||||||
}()
|
}()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue