Merge pull request #2769 from fuweid/shim_related_change
enhance: update v1/v2 runtime
This commit is contained in:
commit
130d07edd2
@ -493,16 +493,24 @@ func (s *Service) processExits() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) checkProcesses(e runc.Exit) {
|
func (s *Service) allProcesses() []rproc.Process {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
|
res := make([]rproc.Process, 0, len(s.processes))
|
||||||
|
for _, p := range s.processes {
|
||||||
|
res = append(res, p)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Service) checkProcesses(e runc.Exit) {
|
||||||
shouldKillAll, err := shouldKillAllOnExit(s.bundle)
|
shouldKillAll, err := shouldKillAllOnExit(s.bundle)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.G(s.context).WithError(err).Error("failed to check shouldKillAll")
|
log.G(s.context).WithError(err).Error("failed to check shouldKillAll")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, p := range s.processes {
|
for _, p := range s.allProcesses() {
|
||||||
if p.Pid() == e.Pid {
|
if p.Pid() == e.Pid {
|
||||||
|
|
||||||
if shouldKillAll {
|
if shouldKillAll {
|
||||||
|
@ -692,6 +692,8 @@ func shouldKillAllOnExit(bundlePath string) (bool, error) {
|
|||||||
func (s *service) allProcesses() (o []rproc.Process) {
|
func (s *service) allProcesses() (o []rproc.Process) {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
|
o = make([]rproc.Process, 0, len(s.processes)+1)
|
||||||
for _, p := range s.processes {
|
for _, p := range s.processes {
|
||||||
o = append(o, p)
|
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) {
|
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 {
|
func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event events.Event) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user