activator stuck in busy loop
Expected Behavior
Knative uses minimal cpu while idle.
Actual Behavior
Knative has two processes busy looping
Steps to Reproduce the Problem
- Install minikube + istio + knative according to the documentation: https://github.com/knative/docs/blob/master/install/Knative-with-Minikube.md
- note that after the install a lot of cpu is being used.
- minikube ssh
- top
:
PID USER PR NI VIRT RES %CPU %MEM TIME+ S COMMAND
15184 root 20 0 127.0m 25.6m 100.0 0.3 18:49.76 S /ko-app -logtostderr=false -stderrthreshold=FATAL
25298 root 20 0 127.0m 26.2m 100.0 0.3 16:19.39 S /ko-app -logtostderr=false -stderrthreshold=FATAL
Two of the activator processes are busy looping and eating a whole cpu core each. If I manually sudo kill
Additional Info
This specific run was using minikube with the vmwarefusion backend, although I also saw very high cpu usage with the hyperkit backend, and also high cpu doing a backend=none on a linux vm. I suspect this is some kind of race where an activator that comes up too early will get stuck in a busy loop.
/kind networking
@vishvananda can you please include some logs from activator when seeing this behavior? thanks
I got the logs from the pod but it didn't log any error or repetitive message. Is there some way to get more detailed logs? I suppose I could try to grab a stack trace.
/area networking
I reran the installation on osx using vmwarefusion and it did not reproduce this time. I have another example running using backend=none on an ubuntu vm. This time there are three broken activators. Here are the logs from one of the busy-looping activators:
{"level":"info","ts":"2018-12-28T01:18:03.073Z","caller":"logging/config.go:84","msg":"Successfully created the logger.","knative.dev/jsonconfig":"{\n \"level\": \"info\",\n \"development\": false,\n \"outputPaths\": [\"stdout\"],\n \"errorOutputPaths\": [\"stderr\"],\n \"encoding\": \"json\",\n \"encoderConfig\": {\n \"timeKey\": \"ts\",\n \"levelKey\": \"level\",\n \"nameKey\": \"logger\",\n \"callerKey\": \"caller\",\n \"messageKey\": \"msg\",\n \"stacktraceKey\": \"stacktrace\",\n \"lineEnding\": \"\",\n \"levelEncoder\": \"\",\n \"timeEncoder\": \"iso8601\",\n \"durationEncoder\": \"\",\n \"callerEncoder\": \"\"\n }\n}\n"}
{"level":"info","ts":"2018-12-28T01:18:03.073Z","caller":"logging/config.go:85","msg":"Logging level set to info"}
{"level":"info","ts":"2018-12-28T01:18:03.073Z","logger":"activator","caller":"activator/main.go:103","msg":"Starting the knative activator","knative.dev/controller":"activator"}
{"level":"info","ts":"2018-12-28T01:18:03.073Z","logger":"activator","caller":"activator/main.go:118","msg":"Initializing OpenCensus Prometheus exporter.","knative.dev/controller":"activator"}
{"level":"info","ts":"2018-12-28T01:18:03.074Z","logger":"activator","caller":"activator/main.go:147","msg":"Connecting to autoscaler at ws://autoscaler.knative-serving.svc.cluster.local:8080","knative.dev/controller":"activator"}
{"level":"info","ts":"2018-12-28T01:18:03.074Z","logger":"activator","caller":"util/env.go:32","msg":"POD_NAME=activator-6677bbc9d6-fpr59","knative.dev/controller":"activator"}
I Sent SIGABRT to the process to collect a stack trace. I got the following:
{"level":"info","ts":"2018-12-28T01:18:03.074Z","logger":"activator","caller":"util/env.go:32","msg":"POD_NAME=activator-6677bbc9d6-fpr59","knative.dev/controller":"activator"}
SIGABRT: abort
PC=0x45a731 m=0 sigcode=0
goroutine 0 [idle]:
runtime.futex(0x1dc70e0, 0x80, 0x0, 0x0, 0x0, 0x7ffea6d98ab8, 0x0, 0x0, 0x7ffea6d98ad8, 0x40a8f2, ...)
/usr/lib/google-golang/src/runtime/sys_linux_amd64.s:531 +0x21
runtime.futexsleep(0x1dc70e0, 0x7ffe00000000, 0xffffffffffffffff)
/usr/lib/google-golang/src/runtime/os_linux.go:46 +0x4b
runtime.notesleep(0x1dc70e0)
/usr/lib/google-golang/src/runtime/lock_futex.go:151 +0xa2
runtime.stoplockedm()
/usr/lib/google-golang/src/runtime/proc.go:2174 +0x8a
runtime.schedule()
/usr/lib/google-golang/src/runtime/proc.go:2574 +0x2d9
runtime.park_m(0xc00040c300)
/usr/lib/google-golang/src/runtime/proc.go:2685 +0xae
runtime.mcall(0x0)
/usr/lib/google-golang/src/runtime/asm_amd64.s:299 +0x5b
goroutine 1 [chan receive]:
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.WaitFor(0xc0003a4ca0, 0xc0004ef568, 0xc000090960, 0x40c428, 0x10)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:330 +0x58
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.PollUntil(0x5f5e100, 0xc0003df568, 0xc000090960, 0xc0003ef130, 0x13844e0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:290 +0x56
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.WaitForCacheSync(0xc000090960, 0xc0003df5c0, 0x1, 0x1, 0x0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:108 +0x79
github.com/knative/serving/vendor/github.com/knative/pkg/configmap.(*InformedWatcher).Start(0xc0003ef180, 0xc000090960, 0xe, 0xc0003aee00)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/github.com/knative/pkg/configmap/informed_watcher.go:80 +0xd3
main.main()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/cmd/activator/main.go:182 +0x176d
goroutine 5 [chan receive]:
github.com/knative/serving/vendor/github.com/golang/glog.(*loggingT).flushDaemon(0x1dc6340)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/github.com/golang/glog/glog.go:882 +0x8b
created by github.com/knative/serving/vendor/github.com/golang/glog.init.0
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/github.com/golang/glog/glog.go:410 +0x203
goroutine 7 [select]:
github.com/knative/serving/vendor/go.opencensus.io/stats/view.(*worker).start(0xc000077dc0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/go.opencensus.io/stats/view/worker.go:144 +0xdd
created by github.com/knative/serving/vendor/go.opencensus.io/stats/view.init.0
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/go.opencensus.io/stats/view/worker.go:29 +0x57
goroutine 8 [syscall, 24 minutes]:
os/signal.signal_recv(0x0)
/usr/lib/google-golang/src/runtime/sigqueue.go:139 +0x9c
os/signal.loop()
/usr/lib/google-golang/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
/usr/lib/google-golang/src/os/signal/signal_unix.go:29 +0x41
goroutine 11 [runnable]:
github.com/knative/serving/pkg/websocket.(*ManagedConnection).keepalive.func1(0xc0003ef090, 0xc000234fb8)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/websocket/connection.go:145 +0xfd
github.com/knative/serving/pkg/websocket.(*ManagedConnection).keepalive(0xc0003ef090, 0x0, 0x0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/websocket/connection.go:154 +0x80
github.com/knative/serving/pkg/websocket.NewDurableSendingConnection.func1(0xc0003ef090)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/websocket/connection.go:96 +0x90
created by github.com/knative/serving/pkg/websocket.NewDurableSendingConnection
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/websocket/connection.go:79 +0x9e
goroutine 12 [chan receive, 24 minutes]:
main.statReporter()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/cmd/activator/main.go:77 +0x55
created by main.main
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/cmd/activator/main.go:149 +0x1461
goroutine 13 [select]:
github.com/knative/serving/pkg/activator/handler.NewConcurrencyReporter.func1(0xc000376540, 0xc000400780, 0xc0003764e0, 0xc00003e039, 0x1a)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/activator/handler/concurrency_reporter.go:49 +0x1b6
created by github.com/knative/serving/pkg/activator/handler.NewConcurrencyReporter
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/pkg/activator/handler/concurrency_reporter.go:42 +0x67
goroutine 15 [chan receive, 24 minutes]:
github.com/knative/serving/vendor/github.com/knative/pkg/signals.SetupSignalHandler.func1(0xc0004007e0, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/github.com/knative/pkg/signals/signal.go:36 +0x34
created by github.com/knative/serving/vendor/github.com/knative/pkg/signals.SetupSignalHandler
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/github.com/knative/pkg/signals/signal.go:35 +0xd0
goroutine 16 [chan receive, 24 minutes]:
main.main.func1(0xc000090960, 0x1381560, 0xc0003cfa40)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/cmd/activator/main.go:175 +0x34
created by main.main
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/cmd/activator/main.go:174 +0x16ab
goroutine 33 [sync.Cond.Wait, 24 minutes]:
sync.runtime_notifyListWait(0xc0000e12b8, 0xc000000000)
/usr/lib/google-golang/src/runtime/sema.go:510 +0xeb
sync.(*Cond).Wait(0xc0000e12a8)
/usr/lib/google-golang/src/sync/cond.go:56 +0x92
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*DeltaFIFO).Pop(0xc0000e1290, 0xc0003d3400, 0x0, 0x0, 0x0, 0x0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/delta_fifo.go:431 +0x99
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*controller).processLoop(0xc0003e5f00)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:150 +0x40
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*controller).processLoop-fm()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:124 +0x2a
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc0000b3ef0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x54
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc0000b3ef0, 0x3b9aca00, 0x0, 0xc0003c1401, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134 +0xbe
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc0000b3ef0, 0x3b9aca00, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88 +0x4d
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*controller).Run(0xc0003e5f00, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:124 +0x299
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*sharedIndexInformer).Run(0xc00012bc20, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:227 +0x40d
created by github.com/knative/serving/vendor/k8s.io/client-go/informers.(*sharedInformerFactory).Start
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/informers/factory.go:130 +0x17b
goroutine 34 [select]:
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.poller.func1.1(0xc000090ba0, 0x5f5e100, 0x0, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:374 +0x153
created by github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.poller.func1
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:357 +0x8c
goroutine 41 [chan receive, 24 minutes]:
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).run.func1.1(0x42a643, 0xc000412dc8, 0x1)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:549 +0x54
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0xc0000b4e18, 0x42a152, 0xc0003ef3e0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:203 +0x9c
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).run.func1()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:548 +0x89
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc000412f68)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x54
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc0000b4f68, 0xdf8475800, 0x0, 0x1098201, 0xc000091080)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134 +0xbe
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc000412f68, 0xdf8475800, 0xc000091080)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88 +0x4d
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).run(0xc0003e5e80)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:546 +0x8d
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).run-fm()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:390 +0x2a
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc0004083e0, 0xc0003d36a0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:71 +0x4f
created by github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:69 +0x62
goroutine 36 [chan receive, 24 minutes]: [10/671]
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*sharedProcessor).run(0xc000408380, 0xc000090c00)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:425 +0x46
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*sharedProcessor).run-fm(0xc000090c00)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:220 +0x34
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithChannel.func1()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:54 +0x2e
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc0003c1490, 0xc0003f3540)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:71 +0x4f
created by github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:69 +0x62
goroutine 37 [chan receive, 24 minutes]:
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*controller).Run.func1(0xc000090960, 0xc0003e5f00)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:103 +0x34
created by github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*controller).Run
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:102 +0x92
goroutine 38 [select]:
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00041ff18, 0x3b9aca00, 0x0, 0xc000000001, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:145 +0x147
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc000414f18, 0x3b9aca00, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88 +0x4d
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*Reflector).Run(0xc0003c2140, 0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/reflector.go:203 +0x168
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*Reflector).Run-fm(0xc000090960)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/controller.go:122 +0x34
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithChannel.func1()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:54 +0x2e
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc0003c14b0, 0xc0003f3560)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:71 +0x4f
created by github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:69 +0x62
goroutine 42 [select, 24 minutes]:
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).pop(0xc0003e5e80)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:517 +0x146
github.com/knative/serving/vendor/k8s.io/client-go/tools/cache.(*processorListener).pop-fm()
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/client-go/tools/cache/shared_informer.go:391 +0x2a
github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc0004083e0, 0xc0003d36b0)
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:71 +0x4f
created by github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait.(*Group).Start
/usr/local/google/home/mattmoor/go/src/github.com/knative/serving/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:69 +0x62
rax 0xca
rbx 0x1dc6fa0
rcx 0x45a733
rdx 0x0
rdi 0x1dc70e0
rsi 0x80
rbp 0x7ffea6d98aa0
rsp 0x7ffea6d98a58
r8 0x0
r9 0x0
r10 0x0
r11 0x286
r12 0xc
r13 0xff
r14 0x1370e30
r15 0x0
rip 0x45a731
rflags 0x286
cs 0x33
fs 0x0
gs 0x0
note that in this case killing the process sometimes fixes it but sometimes it comes back and starts chewing cpu again
Can confirm this is also happening on Minishift running on CentOS 7.
Scaling the knative-serving/activator deployment to 0 and then back to 3 solves the CPU usage problem -- I am not familiar enough with knative to know where to start debugging, and some tips/pointers would be appreciated. :)
Just an update - I am not having this issue outside of Minishift -- No problems so far using knative on a local container-based installation of Openshift
Same issue on Minishift (RHEL 7.5) on macOS.
Could you specify the Knative version used, I'll try to reproduce this. If you're all using 0.2.x, can you try to reproduce with 0.3 as well?
@vishvananda @DuncanDoyle can you please try again with 0.3.0 ?
At this point, I think it's unlikely this will get fixed in 0.4 since we don't have a repro.
Rather than moving it out, I'm going to leave this and close it if we don't get a repro soon.
I'm going to close this. We can /reopen if a repro materializes.