Skip to content

Commit

Permalink
connect: retry proxy socket once for restarted client
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Sep 19, 2019
1 parent 7f1e425 commit 53ab5f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/allocrunner/consulsock_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ func (s *sockProxy) run(alloc *structs.Allocation) error {
hostGRPCSockPath := filepath.Join(s.allocDir.AllocDir, allocdir.AllocGRPCSocket)
listener, err := net.Listen("unix", hostGRPCSockPath)
if err != nil {
return fmt.Errorf("unable to create unix socket for Consul gRPC endpoint: %v", err)
os.Remove(hostGRPCSockPath)
listener, err = net.Listen("unix", hostGRPCSockPath)
if err != nil {
return fmt.Errorf(
"unable to create unix socket for Consul gRPC endpoint: %v", err)
}
}

// The gRPC socket should be usable by all users in case a task is
Expand Down

0 comments on commit 53ab5f9

Please sign in to comment.