Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

Catch config-update exceptions so the poll thread can't crash the process - #1498

Closed
t-ivan-gr wants to merge 1 commit into
pytorch:mainfrom
t-ivan-gr:export-D113579180
Closed

t-ivan-gr wants to merge 1 commit into
pytorch:mainfrom
t-ivan-gr:export-D113579180

Conversation

@t-ivan-gr

@t-ivan-gr t-ivan-gr commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
libkineto's ConfigLoader::updateConfigThread() background thread ran
updateBaseConfig() / configureFromDaemon() with no exception handling, so any
exception escaping that work hits the bare std::thread boundary and calls
std::terminate(), aborting the whole host process.

Wrap the per-iteration config work in try/catch so a config-update failure is
logged and skipped instead of taking down the process; a telemetry/profiler
thread must never abort the host. Load timestamps are advanced before the guarded
work so a persistent failure backs off to the normal interval instead of
hot-looping. The wait/stopFlag_/break control flow stays outside the guard,
so shutdown is unaffected. Applied to both the fbcode and xplat mirrors of
src/ConfigLoader.cpp.

Differential Revision: D113579180

…cess

Summary:
libkineto's `ConfigLoader::updateConfigThread()` background thread ran
`updateBaseConfig()` / `configureFromDaemon()` with no exception handling, so any
exception escaping that work hits the bare `std::thread` boundary and calls
`std::terminate()`, aborting the whole host process.

This is the root cause of a recurring fleet-wide SIGABRT on the
`smart.inference_platform_sp.llm_predictor_gpu_vllm_media` binary (148 coredumps
in one week across 28 realtimeai/ipnext jobs and 107 hosts): during process
teardown OpenSSL's atexit `OPENSSL_cleanup()` frees the global CRYPTO `ex_data`
lock, and the still-running config thread lazily first-builds the
`DynoConfigClient` -> ServiceRouter `getClientFactory()` -> Fizz verifier ->
`X509_STORE_new()`, which then returns NULL. fizz turns the NULL into
`std::bad_alloc`, which is uncaught on the config thread -> `std::terminate`.

Wrap the per-iteration config work in try/catch so a config-update failure is
logged and skipped instead of taking down the process; a telemetry/profiler
thread must never abort the host. Load timestamps are advanced before the guarded
work so a persistent failure backs off to the normal interval instead of
hot-looping. The wait/`stopFlag_`/`break` control flow stays outside the guard,
so shutdown is unaffected. Applied to both the fbcode and xplat mirrors of
`src/ConfigLoader.cpp`.

Differential Revision: D113579180
@meta-cla meta-cla Bot added the cla signed label Jul 25, 2026
@meta-codesync

meta-codesync Bot commented Jul 25, 2026

Copy link
Copy Markdown

@t-ivan-gr has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113579180.

@meta-codesync

meta-codesync Bot commented Jul 27, 2026

Copy link
Copy Markdown

This pull request has been merged in be334e1.

pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 30, 2026
Includes the following commits:

- Clean up dtypes for metadata fields (pytorch/kineto#1499) 6f446fe
- [xpupti] Fix Windows build support for xpupti tests and multi-config generators. (pytorch/kineto#1394) 9e826ca
- Test ConfigLoader on-demand daemon poll ingress (pytorch/kineto#1504) 7674d28
- Remove comment about documentation (pytorch/kineto#1503) eeb3db9
- Remove HTA from README (pytorch/kineto#1502) 46b1c63
- Catch config-update exceptions so the poll thread can't crash the process (pytorch/kineto#1498) be334e1
- Drop EventProfiler config kind from ConfigLoader (pytorch/kineto#1496) e7c97a6
- Remove event-only config surface from Config (pytorch/kineto#1495) a3a0566
- Remove dead event profiler: runtime, CUPTI backends, build wiring (pytorch/kineto#1494) 36c2e05
- Decompose libkineto_defs.bzl source lists into atoms (pytorch/kineto#1493) 328fa51
- Add XPU synchronization events to XPUPTI profiler (pytorch/kineto#1395) 8285e5b
- Re-enable CI linting and lint all C++ (pytorch/kineto#1489) 2c41c01
- Test ConfigLoader handler fan-out (pytorch/kineto#1487) cccc5d1
- Update C++ lint tooling (pytorch/kineto#1488) 57e59e6
Pull Request resolved: #191526
Approved by: https://github.com/scotts
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant