charts icon indicating copy to clipboard operation
charts copied to clipboard

Graceful shutdown is not working without adding sleep in preStop

Open rahul-bansal-sumo opened this issue 8 months ago • 17 comments

Graceful shutdown is not working because API call to endpoint - http://localhost:8080/v1/info/state returns 200 response instantly and kubernetes is killing that pod without waiting for terminationGracePeriodSeconds. While preStop command should wait for active tasks to be completed. Currently there can be 2 workarounds

  1. Add sleep time of Values.worker.terminationGracePeriodSeconds in preStop hook
  2. API call should return 200 response only when all active tasks are completed rather than scheduling them in ScheduleFuture.

Related PR for graceful shutdown - https://github.com/trinodb/charts/pull/226/files#diff-d18e49ecf4264ad889f2d0a897b2075c8c99b542f69e2b91106a8d1809c0b386R190-R202

rahul-bansal-sumo avatar Mar 04 '25 09:03 rahul-bansal-sumo