Bug #77724
closedPyObject reference leak in remote() pickle calls (dispatch_remote)
0%
Description
Description¶
ActivePyModule::dispatch_remote() and ceph_dispatch_remote() serialize and deserialize the arguments and return value of a cross-module remote() call with pickle, invoked like this:
PyObject_CallMethodObjArgs(pmodule, PyUnicode_FromString("loads"), arg, nullptr);
PyObject_CallMethodObjArgs does not steal the method-name reference, and the PyUnicode object returned by PyUnicode_FromString("loads"/"dumps") is never Py_DECREF'd. So every remote() call leaks three PyUnicode objects:
src/mgr/ActivePyModule.cc(dispatch_remote): loads(args), loads(kwargs), dumps(ret)src/mgr/BaseMgrModule.cc(ceph_dispatch_remote): dumps(args), dumps(kwargs), loads(ret)
Impact¶
remote() is the cross-module call path (e.g. the dashboard and other modules calling into the orchestrator), so it is exercised frequently on the active mgr. The leaked objects accumulate for the lifetime of the active mgr and show up as steady RSS growth; on a memory-limited deployment the mgr can be OOM-killed.
Introduced by¶
Commit cd5f7a18b54 "mgr: serialize python objects sent between subinterpreters via remote"
UB Updated by Upkeep Bot 5 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to 66547e6c82c138e66ebc77cab79918d04ab31393
- Fixed In set to v21.3.0-517-g66547e6c82
- Upkeep Timestamp set to 2026-06-29T08:31:36+00:00
UB Updated by Upkeep Bot 5 months ago
- Copied to Backport #77775: tentacle: PyObject reference leak in remote() pickle calls (dispatch_remote) added
UB Updated by Upkeep Bot 5 months ago
- Copied to Backport #77776: umbrella: PyObject reference leak in remote() pickle calls (dispatch_remote) added
UB Updated by Upkeep Bot 5 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-06-29T08:31:36+00:00 to 2026-08-27T18:36:13+00:00
UB Updated by Upkeep Bot 2 months ago
- Status changed from Backporting to Resolved
- Upkeep Timestamp changed from 2026-08-27T18:36:13+00:00 to 2026-09-30T13:11:09+00:00