convox / convox

Issues with cancel func returned by context.WithCancel VET-V0011
Bug risk
Major
12 days agoa year old
the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak
38
39	fmt.Printf("ns=rack at=signal signal=%v terminate=true\n", sig)
40
41	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)42	r.Shutdown(ctx)
43
44	os.Exit(0)
the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak
40
41	fmt.Printf("ns=rack at=signal signal=%v terminate=true\n", sig)
42
43	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)44	s.Shutdown(ctx)
45
46	os.Exit(0)