Skip to content

Commit

Permalink
Merge pull request #33 from ngrok-oss/natasha/hotfix-close-panic
Browse files Browse the repository at this point in the history
Hotfix panic during `closeUnused`
  • Loading branch information
natasha-jarus authored Sep 26, 2024
2 parents e6b6ffc + 47e6f1d commit 9f958fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions fds.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ type Fds struct {
l log15.Logger
}

func (f *Fds) String() string {
res := make([]string, 0, len(f.fds))
for _, fi := range f.fds {
func (f *Fds) String() string { // XXX here?
fds := f.copy()
res := make([]string, 0, len(fds))
for _, fi := range fds {
res = append(res, fi.String())
}
return fmt.Sprintf("fds: %v", res)
Expand Down
6 changes: 3 additions & 3 deletions upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ func (u *Upgrader) Ready() error {
}

// Now cleanup all old FDs while holding the lock
u.Fds.lockMutations(errors.New("closing old listeners"))
defer u.Fds.unlockMutations()
_ = u.Fds.closeUnused()
//u.Fds.lockMutations(errors.New("closing old listeners"))
// defer u.Fds.unlockMutations()
//_ = u.Fds.closeUnused()

return nil
}
Expand Down

0 comments on commit 9f958fe

Please sign in to comment.