]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/log
ceph-ci.git
2 months agotest/neorados: Don't leak watch handle wip-neorados-watch-notify
Adam C. Emerson [Wed, 26 Nov 2025 05:59:35 +0000 (00:59 -0500)]
test/neorados: Don't leak watch handle

Add missing unwatch call.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoneorados: Avoid double cleanup in watch/notify
Adam C. Emerson [Wed, 26 Nov 2025 05:59:13 +0000 (00:59 -0500)]
neorados: Avoid double cleanup in watch/notify

An error coming in after `maybe_cleanup()` is called could trigger it
again. Add a flag to prevent that.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoneorados: On watch error, go through safe cookie interface to cancel
Adam C. Emerson [Wed, 26 Nov 2025 05:54:55 +0000 (00:54 -0500)]
neorados: On watch error, go through safe cookie interface to cancel

Possibly unnecessary defensive programming. At present I'm not sure of
a way this could happen, possibly shutdown while `watch_()` is
executing. In any case, adding a lookup to the error path isn't really
a problem.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoneorados: Actually enforce notification queue limit
Adam C. Emerson [Wed, 26 Nov 2025 05:54:21 +0000 (00:54 -0500)]
neorados: Actually enforce notification queue limit

We were adding an overflow marker on every message above capacity, not
just the first, vitiating the purpose of the bound. The shame, the
shame.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoneorados: Do not try to decode an empty response in notify
Adam C. Emerson [Wed, 26 Nov 2025 03:15:13 +0000 (22:15 -0500)]
neorados: Do not try to decode an empty response in notify

The response can be empty on some errors. Attempting to decode an
empty one loses the error value on valid errors.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoneorados: Go through linger_cancel on `io_context` shutdown
Adam C. Emerson [Wed, 26 Nov 2025 02:54:58 +0000 (21:54 -0500)]
neorados: Go through linger_cancel on `io_context` shutdown

Rather than just dropping the reference, clean up the linger operation
properly within Objecter. Also, clear out handlers before
relinquishing reference to avoid use-after-free.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2 months agoMerge pull request #66539 from ceph/GHSA-8v8w-v8xg-79rf
David Galloway [Fri, 5 Dec 2025 16:49:41 +0000 (11:49 -0500)]
Merge pull request #66539 from ceph/GHSA-8v8w-v8xg-79rf

.github: Harden workflow against arbritrary code injection

2 months ago.github: Harden workflow against arbritrary code injection
David Galloway [Fri, 5 Dec 2025 16:23:27 +0000 (11:23 -0500)]
.github: Harden workflow against arbritrary code injection

See https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf

Signed-off-by: David Galloway <david.galloway@ibm.com>
2 months agoMerge pull request #66505 from tchaikov/mgr-dont-fail-sans-notify-types
Kefu Chai [Fri, 5 Dec 2025 14:49:50 +0000 (22:49 +0800)]
Merge pull request #66505 from tchaikov/mgr-dont-fail-sans-notify-types

mgr/PyModule: clear Python exception when NOTIFY_TYPES is missing

Reviewed-by: John Mulligan <jmulligan@redhat.com>
2 months agoMerge pull request #57263 from mchangir/mgr-snap_schedule-restrict-retention-period...
Venky Shankar [Fri, 5 Dec 2025 10:39:05 +0000 (16:09 +0530)]
Merge pull request #57263 from mchangir/mgr-snap_schedule-restrict-retention-period-multiplier-set

mgr/snap_schedule: restrict retention period multipliers set

Reviewed-by: Venky Shankar <vshankar@redhat.com>
2 months agomgr/PyModule: clear Python exception when NOTIFY_TYPES is missing
Kefu Chai [Thu, 4 Dec 2025 08:05:27 +0000 (16:05 +0800)]
mgr/PyModule: clear Python exception when NOTIFY_TYPES is missing

Commit 4589c4d8ac5 ("mgr: do not require NOTIFY_TYPES in python modules")
changed load_notify_types() to treat missing NOTIFY_TYPES as non-fatal,
but failed to clear the Python exception state set by PyObject_GetAttrString().

When PyObject_GetAttrString() fails to find an attribute, it:
1. Returns nullptr
2. Sets AttributeError in the interpreter's exception state

The exception state persists across subsequent Python C API calls until
explicitly cleared. This causes unrelated operations to fail with misleading
error messages.

Bug Manifestation:
------------------
In PyModule::load() (line 292), the call sequence is:

1. load_subclass_of("MgrModule", &pClass) - succeeds
2. load_notify_types() - sets AttributeError but returns 0 (success)
3. load_subclass_of("MgrStandbyModule", &pStandbyClass) - FAILS

The failure occurs because PyImport_ImportModule() at line 658 checks
PyErr_Occurred() before operating. When it detects the pending AttributeError
from step 2, it refuses to import and returns NULL immediately.

This causes load_subclass_of() to report:
```
  1 mgr[py] Loading python module 'balancer'
 -1 mgr[py] Module balancer has missing NOTIFY_TYPES member
 -1 mgr[py] Module not found: 'mgr_module'
 -1 mgr[py] AttributeError: type object 'Module' has no attribute 'NOTIFY_TYPES'
```

This error is misleading - mgr_module exists and is importable, but the
import fails due to the uncleared exception from an unrelated operation.

Without this fix, modules without NOTIFY_TYPES may fail to load their
standby class, or cause subsequent module loads to fail entirely with
confusing error messages pointing to the wrong module.

Fix:
----
This patch follows Python's EAFP (Easier to Ask for Forgiveness than
Permission) philosophy by attempting the attribute access and handling the
expected AttributeError, rather than checking preconditions with
PyObject_HasAttrString() (LBYL approach). The EAFP approach:

- Is more pythonic and idiomatic
- Requires only one API call instead of two (more efficient)
- Properly distinguishes expected errors (AttributeError) from unexpected
  errors (e.g., interpreter shutdown, memory errors)
- Handles unexpected errors appropriately by reporting and returning -EINVAL

Implementation:
- Use PyErr_ExceptionMatches() to check for expected AttributeError
- Clear expected exception with PyErr_Clear()
- Report unexpected exceptions via handle_pyerror()

Refs: 4589c4d8ac5 ("mgr: do not require NOTIFY_TYPES in python modules")
Refs: https://tracker.ceph.com/issues/55835
Fixes: https://tracker.ceph.com/issues/70789
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
2 months agoMerge pull request #65274 from ifed01/wip-ifed-more-max-lat
Igor Fedotov [Wed, 3 Dec 2025 14:46:08 +0000 (17:46 +0300)]
Merge pull request #65274 from ifed01/wip-ifed-more-max-lat

os/bluestore: track max latencies for key bluestore/bluefs perf counters

Reviewed-by: Adam Kupczyk <akupczyk@ibm.com>