summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-06-18 13:52:09 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-19 15:32:34 +0000
commit2d0d1c4b5f12b50904728f764f4ac36f00ccace0 (patch)
tree04da69d7c305592a81bf64430f5364c69f80165f
parentaa1ccfb094eba74c6523e6c2e10244aa4de06f7c (diff)
downloadpodman-2d0d1c4b5f12b50904728f764f4ac36f00ccace0.tar.gz
podman-2d0d1c4b5f12b50904728f764f4ac36f00ccace0.tar.bz2
podman-2d0d1c4b5f12b50904728f764f4ac36f00ccace0.zip
Errors from closing a netns on removal from DB are nonfatal
Upon updating a container, if its network namespace has been removed, we attempt to clean up the network namespace locally, to ensure we don't leave hanging file descriptors. This triggers cleanup code which assumes the network namespace still exists, but it almost certainly was removed by whoever removed it from the database. As such, we end up with unavoidable errors if we don't want to leak FDs. Make these errors nonfatal and log them because of this. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #962 Approved by: rhatdan
-rw-r--r--libpod/boltdb_state.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go
index 5e70a2554..7880265b6 100644
--- a/libpod/boltdb_state.go
+++ b/libpod/boltdb_state.go
@@ -7,6 +7,7 @@ import (
"github.com/boltdb/bolt"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
)
// BoltState is a state implementation backed by a Bolt DB
@@ -455,7 +456,7 @@ func (s *BoltState) UpdateContainer(ctr *Container) error {
} else {
// Tear down the existing namespace
if err := s.runtime.teardownNetNS(ctr); err != nil {
- return err
+ logrus.Warnf(err.Error())
}
// Open the new network namespace
@@ -469,7 +470,7 @@ func (s *BoltState) UpdateContainer(ctr *Container) error {
// The container no longer has a network namespace
// Tear down the old one
if err := s.runtime.teardownNetNS(ctr); err != nil {
- return err
+ logrus.Warnf(err.Error())
}
}