pipe-cd / pipecd

The One CD for All {applications, platforms, operations}
https://pipecd.dev
Apache License 2.0
1.09k stars 153 forks source link

logpersister graceful shutdown #5156

Closed naonao2323 closed 2 months ago

naonao2323 commented 2 months ago

What would you like to be added: The flushAll method in the logpersister package should wait for all flushFromLastCheckpoint calls to complete before proceeding. Currently, it initiates these calls asynchronously using go sp.flushFromLastCheckpoint(ctx), which may lead to the cancel being executed immediately, not allowing the expected persister.gracePeriod(30-second timeout) to function correctly.

https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/logpersister/persister.go#L159 Why is this needed:

khanhtc1202 commented 2 months ago

Thanks for your interest. Can you submit a fix for this 👀