You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when the main conduit process receives a shutdown signal, it abruptly tears down all its goroutines even though the pipeline shares a common context.Context object that is supposed to make it possible to exit more gracefully and in a deterministic fashion. In particular, it is currently not possible to coordinate a new requirement such as having each plugin finish the current round before exit.
Solution
This story posits the following goals (though after further discussion we may want to trim the goals or break them out into separate issues):
Consider adding a new conduit stop command that looks for the PID file and sends an interrupt to that process
Consider the possibility of letting each plugin go to the end. Even better make this configurable via the type of interrupt signal received. EG:
conduit stop now would send an os.Interrupt (or a kill -TERM $(PROCNUM) ) and kills all plugin processes immediately
conduit stop end-of-round produces something like kill -USR1 $(PROCNUM) and kills plugin process in the following order at the end of its current round: Importer → Processors → Exporter
Some questions
Should we add WhyStopped() to the Pipeline interface, and send a telemetry observation with this context cancellation cause?
Do we still need Stop() in the Pipeline's interface?
Do we need sentinel error to act as sentinel cancelation causes and to distinguish between different legitimate reasons?
Some possible code in the client making use of the stop cause:
The pipeline object is managed using a context with a cancel function and a wait group. This setup is strange.
Rather than managing the process internal to the pipeline, Start() should be renamed to Run(), and Run() should be blocking. If the context is cancelled Run() can call Stop() automatically.
The caller would then use a waitgroup and run the pipeline in a go-routine if it wants to. Run() could also return the error directly rather than implementing setError and Error.
Problem
Currently, when the main conduit process receives a shutdown signal, it abruptly tears down all its goroutines even though the pipeline shares a common
context.Context
object that is supposed to make it possible to exit more gracefully and in a deterministic fashion. In particular, it is currently not possible to coordinate a new requirement such as having each plugin finish the current round before exit.Solution
This story posits the following goals (though after further discussion we may want to trim the goals or break them out into separate issues):
Stop()
. As a starting point refer to enhancement: graceful pipeline interrupt #97 but better crafting of where to place the signal handling is required. See also Rework pipeline process management #99conduit stop
command that looks for the PID file and sends an interrupt to that processconduit stop now
would send anos.Interrupt
(or akill -TERM $(PROCNUM)
) and kills all plugin processes immediatelyconduit stop end-of-round
produces something likekill -USR1 $(PROCNUM)
and kills plugin process in the following order at the end of its current round:Importer
→Processors
→Exporter
Some questions
WhyStopped()
to the Pipeline interface, and send a telemetry observation with this context cancellation cause?Stop()
in the Pipeline's interface?Some possible code in the client making use of the stop cause:
Dependencies
None
Urgency
Low - I haven't heard of other developers in the community complain of this issue.
The text was updated successfully, but these errors were encountered: