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
cron.go
func (c *Cron) run(ctx context.Context) {
... line 256
m, err := c.etcdclient.NewMutex(fmt.Sprintf("etcd_cron/%s/%d", e.Job.canonicalName(), effective.Unix()))
if err != nil {
go c.etcdErrorsHandler(ctx, e.Job, errors.Wrapf(err, "fail to create etcd mutex for job '%v'", e.Job.Name))
return
}
in etcd.go
func (c etcdMutexBuilder) NewMutex(pfx string) (DistributedMutex, error) {
// As each task iteration lock name is unique, we don't really care about unlocking it
// So the etcd lease will alst 10 minutes, it ensures that even if another server
// clock is ill-configured (with a maximum span of 10 minutes), it won't execute the task
// twice.
session, err := concurrency.NewSession(c.Client, concurrency.WithTTL(60*10))
if err != nil {
return nil, err
}
return concurrency.NewMutex(session, pfx), nil
}
it seems the session has never been closed
Each time the task is triggered, a New mutext is created, but the session never had the chance to be closed.
The text was updated successfully, but these errors were encountered:
Hello,
I found the code has a goroutine leak problem:
Each time the task is triggered, a New mutext is created, but the session never had the chance to be closed.
The text was updated successfully, but these errors were encountered: