enhance: update v1/v2 runtime
1. avoid dead lock during kill, fetch allProcesses before handle events 2. use argu's ctx instead of context.Backgroud() in openlog Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
@@ -692,6 +692,8 @@ func shouldKillAllOnExit(bundlePath string) (bool, error) {
|
||||
func (s *service) allProcesses() (o []rproc.Process) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
o = make([]rproc.Process, 0, len(s.processes)+1)
|
||||
for _, p := range s.processes {
|
||||
o = append(o, p)
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func handleSignals(logger *logrus.Entry, signals chan os.Signal) error {
|
||||
}
|
||||
|
||||
func openLog(ctx context.Context, _ string) (io.Writer, error) {
|
||||
return fifo.OpenFifo(context.Background(), "log", unix.O_WRONLY, 0700)
|
||||
return fifo.OpenFifo(ctx, "log", unix.O_WRONLY, 0700)
|
||||
}
|
||||
|
||||
func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event events.Event) error {
|
||||
|
||||
Reference in New Issue
Block a user