Skip to content

Commit

Permalink
Merge pull request #833 from mrpalide/bugfix/panic-on-shutdown
Browse files Browse the repository at this point in the history
Bugfix/panic on shutdown
  • Loading branch information
jdknives authored Jul 7, 2021
2 parents 4fcac2a + a0bc9c9 commit a663372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions pkg/snet/arclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,9 @@ func (c *httpClient) Close() error {
if err := c.sudphConn.Close(); err != nil {
c.log.WithError(err).Errorf("Failed to close SUDPH")
}
close(c.closed)
}

close(c.closed)

return nil
}

Expand Down
15 changes: 5 additions & 10 deletions pkg/snet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,13 @@ func (n *Network) Close() error {
if directClient == nil {
continue
}
wg.Add(1)
go func(client directtp.Client) {
err := client.Close()
if err != nil {
directErrors <- err
}
wg.Done()
}(directClient)
err := directClient.Close()
if err != nil {
directErrors <- err
}
}
wg.Wait()
close(directErrors)

wg.Wait()
if dmsgErr != nil {
return dmsgErr
}
Expand Down

0 comments on commit a663372

Please sign in to comment.