cron mode: instance shutting down despite min_instance set to 1
Issue #283
resolved
VidGrind running in cron mode is shutting down despite the min_instances being set to 1 in cron_app.yaml.
Here’s the relevant logs:
INFO 2023-08-20T15:40:48.037423Z [pid1] Received terminated signal [session:1SZ6Z60]
INFO 2023-08-20T15:40:48.037805Z [pid1] Sending terminated signal to processes [session:1SZ6Z60]
INFO 2023-08-20T15:40:48.037817Z [pid1] Waiting 2s to allow shutdown processing [session:1SZ6Z60]
INFO 2023-08-20T15:40:48.037826Z [pid1-nginx] Propagating terminated signal to nginx (pid 21) [session:1SZ6Z60]
INFO 2023-08-20T15:40:48.037834Z [pid1-app] Propagating terminated signal to app (pid 12) [session:1SZ6Z60]
WARNING 2023-08-20T15:40:48.039724Z [pid1-app] Exit -1 app (pid 12): /layers/google.go.build/bin/main [session:1SZ6Z60]
INFO 2023-08-20T15:40:48.044483Z [pid1-nginx] Exit 0 nginx (pid 21): /usr/sbin/nginx -c /tmp/nginxconf-3618552761/nginx.conf [session:1SZ6Z60]
INFO 2023-08-20T15:40:50.036400Z [pid1] Stopping all processes [session:1SZ6Z60]
INFO 2023-08-20T15:40:50.040252Z [pid1] Done [session:1SZ6Z60]
INFO 2023-08-20T15:40:50.040263Z [pid1] shutdown [session:1SZ6Z60]
INFO 2023-08-21T23:32:14.338175Z [protoPayload.method: GET] [protoPayload.status: 200] [protoPayload.responseSize: 151 B] [protoPayload.latency: 31.979 s] [protoPayload.userAgent: Go-http-client 2.0] /cron/set/934318202658/CamBR
INFO 2023-08-21T23:32:14.558144Z [pid1] started [session:T5VXP56]
DEBUG 2023-08-21T23:32:14.561176Z [pid1-app] Using app start info from /srv/.googleconfig/app_start.json: &main.appStart{Entrypoint:struct { Type string "json:\"type\""; UnparsedValue string "json:\"unparsed_value\""; Command string "json:\"command\""; WorkDir string "json:\"workdir\"" }{Type:"Generated", UnparsedValue:"", Command:"main", WorkDir:""}, EntrypointFromAppYAML:"", EntrypointContents:"", Runtime:"go118"} [session:T5VXP56]
INFO 2023-08-21T23:32:14.561382Z [pid1] Starting processes [app nginx] [session:T5VXP56]
INFO 2023-08-21T23:32:14.562554Z [pid1-app] app has no prerequisites, starting immediately [session:T5VXP56]
INFO 2023-08-21T23:32:14.562850Z [pid1-nginx] nginx waiting for any of 4 prerequisite(s): [portbind:tcp:127.0.0.1:8081 portbind:tcp:localhost:8080 portbind:tcp:localhost:8081 portbind:unix:/tmp/google-config/app.sock] [session:T5VXP56]
INFO 2023-08-21T23:32:14.664994Z [pid1-app] Starting app (pid 11): /layers/google.go.build/bin/main [session:T5VXP56]
DEFAULT 2023-08-21T23:32:15.139103Z 2023/08/21 23:32:15 Running in App Engine mode
DEFAULT 2023-08-21T23:32:15.878487Z 2023/08/21 23:32:15 cron mode
DEFAULT 2023-08-21T23:32:17.309347Z 2023/08/21 23:32:17 setting cron: TestCron
Line 10 the session shutdown, line 11 is when I added a new cron which woke the session up.
Between these times, crons that were supposed to run did not run.
I’m not sure why it shutdown despite the configuration. One solution is to implement a heartbeat cron to keep the session alive.
Comments (4)
-
-
@Alan Noble Has this been resolved?
-
Yes, the warmup handler ensures that one instance is always running.
-
- changed status to resolved
- Log in to comment
The issue is that min_idle_instances is set to zero. It should be one.