Skip to content

Commit

Permalink
improves GC, #22
Browse files Browse the repository at this point in the history
  • Loading branch information
mhausenblas committed Feb 13, 2018
1 parent 004b9d8 commit 2b350d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions gc.go
Expand Up @@ -6,11 +6,14 @@ import (
)

var (
gcPause = 10 * time.Second
maxOrphanRuntimeSec = 20.0
// how often we check for orphans:
gcPause = 10 * time.Second
// how long a pod of a terminating dproc can run
// until we consider it an orphan (in seconds):
maxOrphanRuntimeSec = 30.0
)

func rmOrphanTerminatingDProcs() {
func gcDProcs() {
for {
poNstart, err := kubectl(true, "get", "po",
"--selector=dproctype="+string(DProcTerminating), "-o=custom-columns=:metadata.name,:status.startTime", "--field-selector=status.phase=Running",
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -120,6 +120,6 @@ func main() {
rwatch.init(currentenv().evt)
go rwatch.run()
// kick off garbage collection:
go rmOrphanTerminatingDProcs()
go gcDProcs()
interpreti(rl)
}

0 comments on commit 2b350d1

Please sign in to comment.