Repository navigation
Commit e5736f5
[fix](be) Deregister the result buffer metric hook when the Arrow Flight cancel test fixture ends
### What problem does this PR solve?
Issue Number: None
Related PR: #69945
Problem Summary:
`ResultBufferMgr`'s constructor registers the process-wide
`result_buffer_block_count` hook, and the hook captures the manager. Only
`ResultBufferMgr::stop()` deregisters it. `ArrowFlightCancelTest` builds a
manager per test and never stopped it, so after each test the global
metric entity kept a hook that pointed at a destroyed manager. A later
metric collection with hooks enabled would read freed memory. Because
`MetricEntity::register_hook` uses `emplace`, a later fixture could not
replace a stale hook either.
`TearDown()` now calls `_mgr.stop()` after restoring the previous
manager, the same way `LoadChannelMgrTest` stops its `LoadChannelMgr`.
The manager is never `init()`ed here, so `stop()` only removes the hook
and its gauge; no cleaner thread is joined.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `ArrowFlightCancelTest.*`, `ArrowFlightRemoteCancelTest.*`, `ResultBufferMgrTest.*`
- Behavior changed: No
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent b0e2959 commit e5736f5
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
0 commit comments