Skip to content

Commit 9f958fe

Browse files
Merge pull request #33 from ngrok-oss/natasha/hotfix-close-panic
Hotfix panic during `closeUnused`
2 parents e6b6ffc + 47e6f1d commit 9f958fe

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

fds.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ type Fds struct {
131131
l log15.Logger
132132
}
133133

134-
func (f *Fds) String() string {
135-
res := make([]string, 0, len(f.fds))
136-
for _, fi := range f.fds {
134+
func (f *Fds) String() string { // XXX here?
135+
fds := f.copy()
136+
res := make([]string, 0, len(fds))
137+
for _, fi := range fds {
137138
res = append(res, fi.String())
138139
}
139140
return fmt.Sprintf("fds: %v", res)

upgrader.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ func (u *Upgrader) Ready() error {
240240
}
241241

242242
// Now cleanup all old FDs while holding the lock
243-
u.Fds.lockMutations(errors.New("closing old listeners"))
244-
defer u.Fds.unlockMutations()
245-
_ = u.Fds.closeUnused()
243+
//u.Fds.lockMutations(errors.New("closing old listeners"))
244+
// defer u.Fds.unlockMutations()
245+
//_ = u.Fds.closeUnused()
246246

247247
return nil
248248
}

0 commit comments

Comments
 (0)