SIGINT after a database connection failure renders stork-server unresponsive to signals
- Have a functioning stork-server.
- Shut down the database server.
- Wait for a periodic pull to fail. You should see something like this:
pg: 2024/07/02 13:03:41 base.go:130: cancelRequest failed: dial unix /var/run/postgresql/.s.PGSQL.5432: connect: no such file or directory ERRO[2024-07-02 13:03:41] periodicexecutor.go:170 Errors were encountered while pulling data from apps: write unix @->/var/run/postgresql/.s.PGSQL.5432: write: broken pipe problem getting kea apps from database isc.org/stork/server/database/model.GetAppsByType /home/andrei/work/isc/stork/backend/server/database/model/app.go:397 isc.org/stork/server/apps/kea.(*HAStatusPuller).pullData /home/andrei/work/isc/stork/backend/server/apps/kea/status.go:241 isc.org/stork/server/agentcomm.NewPeriodicPuller.func1 /home/andrei/work/isc/stork/backend/server/agentcomm/puller.go:42 isc.org/stork/util.(*PeriodicExecutor).executorLoop /home/andrei/work/isc/stork/backend/util/periodicexecutor.go:167 runtime.goexit /home/andrei/work/isc/stork/tools/golang/go/src/runtime/asm_amd64.s:1695
- Attempt to send a SIGINT/ctrl+C/cmd+C like one might want to do to then restart the stork-server after fixing the database.
- Get this error:
ERRO[2024-07-02 12:47:41] eventcenter.go:181 Problem adding event to db: ERROR #42P01 relation "event" does not exist problem inserting event &{ID:0 CreatedAt:0001-01-01 00:00:00 +0000 UTC Text:shutting down Stork Server Level:info Relations:0xc0002abb00 Details: SSEStreams:[]} isc.org/stork/server/database/model.AddEvent /home/andrei/work/isc/stork/backend/server/database/model/event.go:68 isc.org/stork/server/eventcenter.(*eventCenter).mainLoop /home/andrei/work/isc/stork/backend/server/eventcenter/eventcenter.go:179 runtime.goexit /home/andrei/work/isc/stork/tools/golang/go/src/runtime/asm_amd64.s:1695
stork-server
seems still operational. Web UI is accessible. Periodic pulls work. But subsequent SIGHUPs, SIGINTs, and probably other signals have no effect. SIGKILL and SIGQUIT properly terminate the process.
The expectation was that the stork-server
process either terminates or is able to handle signals further.
Stork built from sources, v1.17.0
, cd5181e932425ff14ac3304593a4c3f726d175fb
.