engine: resources: Mask normal closing error
This could possibly be fixed upstream, but we'll workaround it for now.
This commit is contained in:
@@ -19,6 +19,7 @@ package resources
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -449,7 +450,10 @@ func (obj *DHCPServerRes) Watch(ctx context.Context) error {
|
|||||||
defer close(closeSignal)
|
defer close(closeSignal)
|
||||||
|
|
||||||
err := server.Serve() // blocks until Close() is called I hope!
|
err := server.Serve() // blocks until Close() is called I hope!
|
||||||
if err == nil {
|
// TODO: getting this error is probably a bug, please see:
|
||||||
|
// https://github.com/insomniacslk/dhcp/issues/376
|
||||||
|
isClosing := errors.Is(err, net.ErrClosed)
|
||||||
|
if err == nil || isClosing {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if this returned on its own, then closeSignal can be used...
|
// if this returned on its own, then closeSignal can be used...
|
||||||
|
|||||||
Reference in New Issue
Block a user