]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/log
ceph.git
2 months agopybind: remove deprecated PyEval_InitThreads() calls 66508/head
Kefu Chai [Thu, 4 Dec 2025 10:17:25 +0000 (18:17 +0800)]
pybind: remove deprecated PyEval_InitThreads() calls

Remove all calls to PyEval_InitThreads(), which has been deprecated since
Python 3.9 and generates compiler warnings on Python 3.13+.

Background:
-----------
PyEval_InitThreads() was used to initialize Python's GIL (Global Interpreter
Lock) and threading support. In Python 3.7+, the GIL is automatically
initialized, making this function a no-op.

From Python 3.9 source (Python/ceval.c:315-318):
  void PyEval_InitThreads(void)
  {
      /* Do nothing */
  }

The function was officially deprecated in Python 3.9:
https://docs.python.org/3/whatsnew/3.9.html
  "Deprecated: PyEval_InitThreads() and PyEval_ThreadsInitialized()
   are now deprecated and will be removed in Python 3.13."

As of Python 3.13, calling this function produces deprecation warnings:
  warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]

Rationale:
----------
Ceph enforces a minimum Python version of 3.9 (CMakeLists.txt:630):
  if(Python3_VERSION VERSION_LESS 3.9)
    message(FATAL_ERROR "... please use Python 3.9 and up")

Since we require Python 3.9+, and PyEval_InitThreads() is a no-op in
Python 3.9+, these calls serve no purpose and can be safely removed.

Changes:
--------
- Removed PyEval_InitThreads() declaration from cdef extern blocks
- Removed PyEval_InitThreads() calls from __init__/__cinit__ methods

Affected files:
- src/pybind/rados/rados.pyx (Rados.__init__)
- src/pybind/rgw/rgw.pyx (LibRGWFS.__cinit__)
- src/pybind/cephfs/cephfs.pyx (LibCephFS.__cinit__)

References:
- Python 3.9 source: https://github.com/python/cpython/blob/3.9/Python/ceval.c#L315-L318
- Python 3.9 What's New: https://docs.python.org/3/whatsnew/3.9.html
- Python 3.13 deprecation: https://docs.python.org/3.13/c-api/init.html#c.PyEval_InitThreads

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>