Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
041fa647
Commit
041fa647
authored
Nov 18, 2016
by
Jing Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove checking mount point in cleanupOrphanedPodDirs
To avoid nfs hung problem, remove the mountpoint checking code in cleanupOrphanedPodDirs(). This removal should still be safe.
parent
ec1371b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
17 deletions
+4
-17
kubelet.go
pkg/kubelet/kubelet.go
+2
-2
kubelet_volumes.go
pkg/kubelet/kubelet_volumes.go
+2
-15
No files found.
pkg/kubelet/kubelet.go
View file @
041fa647
...
@@ -1851,8 +1851,8 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle
...
@@ -1851,8 +1851,8 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle
}
}
case
<-
housekeepingCh
:
case
<-
housekeepingCh
:
if
!
kl
.
sourcesReady
.
AllReady
()
{
if
!
kl
.
sourcesReady
.
AllReady
()
{
// If the sources aren't ready
, skip housekeeping, as we may
// If the sources aren't ready
or volume manager has not yet synced the states,
// accidentally delete pods from unready sources.
//
skip housekeeping, as we may
accidentally delete pods from unready sources.
glog
.
V
(
4
)
.
Infof
(
"SyncLoop (housekeeping, skipped): sources aren't ready yet."
)
glog
.
V
(
4
)
.
Infof
(
"SyncLoop (housekeeping, skipped): sources aren't ready yet."
)
}
else
{
}
else
{
glog
.
V
(
4
)
.
Infof
(
"SyncLoop (housekeeping)"
)
glog
.
V
(
4
)
.
Infof
(
"SyncLoop (housekeeping)"
)
...
...
pkg/kubelet/kubelet_volumes.go
View file @
041fa647
...
@@ -25,7 +25,6 @@ import (
...
@@ -25,7 +25,6 @@ import (
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/types"
utilerrors
"k8s.io/kubernetes/pkg/util/errors"
utilerrors
"k8s.io/kubernetes/pkg/util/errors"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
volumetypes
"k8s.io/kubernetes/pkg/volume/util/types"
volumetypes
"k8s.io/kubernetes/pkg/volume/util/types"
...
@@ -105,24 +104,12 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(
...
@@ -105,24 +104,12 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(
glog
.
V
(
3
)
.
Infof
(
"Orphaned pod %q found, but volumes are not cleaned up"
,
uid
)
glog
.
V
(
3
)
.
Infof
(
"Orphaned pod %q found, but volumes are not cleaned up"
,
uid
)
continue
continue
}
}
//
Check whether volume is still mounted on disk. If so
, do not delete directory
//
If there are still volume directories
, do not delete directory
volumePaths
,
err
:=
kl
.
getPodVolumePathListFromDisk
(
uid
)
volumePaths
,
err
:=
kl
.
getPodVolumePathListFromDisk
(
uid
)
if
err
!=
nil
{
if
err
!=
nil
||
len
(
volumePaths
)
>
0
{
glog
.
Errorf
(
"Orphaned pod %q found, but error %v occured during reading volume dir from disk"
,
uid
,
err
)
glog
.
Errorf
(
"Orphaned pod %q found, but error %v occured during reading volume dir from disk"
,
uid
,
err
)
continue
continue
}
else
if
len
(
volumePaths
)
>
0
{
for
_
,
path
:=
range
volumePaths
{
notMount
,
err
:=
mount
.
IsNotMountPoint
(
path
)
if
err
==
nil
&&
notMount
{
glog
.
V
(
2
)
.
Infof
(
"Volume path %q is no longer mounted, remove it"
,
path
)
os
.
Remove
(
path
)
}
else
{
glog
.
Errorf
(
"Orphaned pod %q found, but it might still mounted with error %v"
,
uid
,
err
)
}
}
continue
}
}
glog
.
V
(
3
)
.
Infof
(
"Orphaned pod %q found, removing"
,
uid
)
glog
.
V
(
3
)
.
Infof
(
"Orphaned pod %q found, removing"
,
uid
)
if
err
:=
os
.
RemoveAll
(
kl
.
getPodDir
(
uid
));
err
!=
nil
{
if
err
:=
os
.
RemoveAll
(
kl
.
getPodDir
(
uid
));
err
!=
nil
{
glog
.
Errorf
(
"Failed to remove orphaned pod %q dir; err: %v"
,
uid
,
err
)
glog
.
Errorf
(
"Failed to remove orphaned pod %q dir; err: %v"
,
uid
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment