Skip to content

Commit

Permalink
shutdown control connections first to prevent deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
purplefox committed Dec 6, 2024
1 parent 9d6928b commit 5a71d52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,14 @@ func (a *Agent) Stop() error {
if !a.started {
return nil
}
if err := a.compactionWorkersService.Stop(); err != nil {
if err := a.kafkaServer.Stop(); err != nil {
return err
}
if err := a.transportServer.Stop(); err != nil {
a.controlClientCache.Close()
if err := a.compactionWorkersService.Stop(); err != nil {
return err
}
if err := a.kafkaServer.Stop(); err != nil {
if err := a.transportServer.Stop(); err != nil {
return err
}
if err := a.txCoordinator.Stop(); err != nil {
Expand All @@ -242,7 +243,6 @@ func (a *Agent) Stop() error {
if err := a.controller.Stop(); err != nil {
return err
}
a.controlClientCache.Close()
a.connCaches.Close()
a.started = false
return nil
Expand Down

0 comments on commit 5a71d52

Please sign in to comment.