-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.6affects-7.0affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.2severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
If you run tidb with a very long time with many TTL tables, you can seem some memory leak:
- dettachStatsCollector , see:
Lines 3660 to 3665 in 9e20208
func detachStatsCollector(s *session) *session { | |
s.statsCollector = nil | |
s.idxUsageCollector = nil | |
return s | |
} |
it only sets two collectors to nil but did not call Delete
for it.
- The context created here is not guaranteed to be cancelled finally:
tidb/ttl/ttlworker/task_manager.go
Lines 391 to 399 in 9e20208
ctx, cancel := context.WithCancel(m.ctx) | |
scanTask := &ttlScanTask{ | |
ctx: ctx, | |
TTLTask: task, | |
tbl: table, | |
statistics: &ttlStatistics{}, | |
} |
Metadata
Metadata
Assignees
Labels
affects-6.6affects-7.0affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.2severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.