Skip to content

Commit

Permalink
Don't say we've shut down cluster listener before having done so (has…
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored and Artem Alexandrov committed Feb 4, 2022
1 parent d35a3b0 commit 263d358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog/13679.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core: Fix how we report the cluster listener is done, prevents `bind: address already in use` errors.
```
6 changes: 3 additions & 3 deletions vault/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"crypto/x509"
"errors"
"fmt"
"github.com/hashicorp/vault/sdk/helper/certutil"
"github.com/hashicorp/vault/sdk/helper/tlsutil"
"net"
"net/url"
"os"
Expand All @@ -16,7 +14,9 @@ import (
"time"

log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/helper/certutil"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/vault/sdk/helper/tlsutil"
"golang.org/x/net/http2"
)

Expand Down Expand Up @@ -279,9 +279,9 @@ func (cl *Listener) Run(ctx context.Context) error {
// Start our listening loop
go func(closeCh chan struct{}, tlsLn net.Listener) {
defer func() {
cl.shutdownWg.Done()
tlsLn.Close()
close(closeCh)
cl.shutdownWg.Done()
}()

// baseDelay is the initial delay after an Accept() error before attempting again
Expand Down

0 comments on commit 263d358

Please sign in to comment.