Project

General

Profile

Actions

Bug #77724

closed
KC KC

PyObject reference leak in remote() pickle calls (dispatch_remote)

Bug #77724: PyObject reference leak in remote() pickle calls (dispatch_remote)

Added by Kefu Chai 5 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle umbrella
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-517-g66547e6c82
Released In:
Upkeep Timestamp:
2026-09-30T13:11:09+00:00

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"


Related issues 2 (0 open — 2 closed)

Copied to mgr - Backport #77775: tentacle: PyObject reference leak in remote() pickle calls (dispatch_remote)ResolvedKefu Chai

Actions
Copied to mgr - Backport #77776: umbrella: PyObject reference leak in remote() pickle calls (dispatch_remote)ResolvedKefu Chai

Actions

KC Updated by Kefu Chai 5 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Severity changed from 2 - major to 3 - minor
  • Pull request ID set to 69755

the severity is minor as the leak only accumulates under sustained remote() traffic. and the size of leakage is relative small.

KC Updated by Kefu Chai 5 months ago Actions #2

and after auditing the code, i found that this only impacted the mgr running in active mode.

UB Updated by Upkeep Bot 5 months ago Actions #3

  • 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 Actions #4

  • Copied to Backport #77775: tentacle: PyObject reference leak in remote() pickle calls (dispatch_remote) added

UB Updated by Upkeep Bot 5 months ago Actions #5

  • Copied to Backport #77776: umbrella: PyObject reference leak in remote() pickle calls (dispatch_remote) added

UB Updated by Upkeep Bot 5 months ago Actions #6

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #7

  • 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 Actions #8

  • 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
Actions

Also available in: PDF Atom