Project

General

Profile

Bug #37472

Cython 0.29 removed support for subinterpreters: raises "ImportError: Interpreter change detected ..."

Added by Ricardo Dias 8 months ago. Updated 3 months ago.

Status:
Pending Backport
Priority:
Urgent
Assignee:
Category:
ceph-mgr
Target version:
-
Start date:
11/29/2018
Due date:
% Done:

0%

Source:
Tags:
Backport:
mimic
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

The latest version of Cython v0.29 removed the support for python subinterpreters [1, 2]

This creates a serious problem in ceph-mgr because all mgr modules import the rados cython module in their own python subinterpreter.
When running the ceph-mgr daemon in a system with Cython 0.29, all the modules except the first one will raise an exception when loading the module.
The error message is:

2018-10-31 13:52:33.813 7f978235e740 -1 mgr[py] Traceback (most recent call last):
  File "/ceph/src/pybind/mgr/mgr_module.py", line 8, in <module>
    import rados
ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process.

[1]
https://github.com/cython/cython/commit/7e27c7cd51a2f048cd6d3c246740cd977f8d2e50
[2] http://blog.behnel.de/posts/whats-new-in-cython-029.html


Related issues

Related to mgr - Bug #38407: Funny issues with python sub-interpreters New 02/20/2019
Related to mgr - Bug #38788: ceph-mgr: ImportError: Interpreter change detected - this module can only be loaded into one interprer per process. Pending Backport 03/17/2019
Copied to mgr - Backport #39593: mimic: Cython 0.29 removed support for subinterpreters: raises "ImportError: Interpreter change detected ..." In Progress

History

#1 Updated by Nathan Cutler 8 months ago

  • Status changed from New to Need Review
  • Pull request ID set to 25328

#2 Updated by Sage Weil 8 months ago

  • Status changed from Need Review to Verified
  • Priority changed from High to Urgent

merged https://github.com/ceph/ceph/pull/25328

I'm not sure we should close this bug though since the packaging change just means we will fail at build time instead of run time; we still need to sort out what to do wrt the cython change.

#3 Updated by Nathan Cutler 8 months ago

  • Pull request ID deleted (25328)

#4 Updated by Brad Hubbard 7 months ago

This breaks building on fedora rawhide (fc30) where only 0.29.1-1.fc30 is available.

https://copr-be.cloud.fedoraproject.org/results/badone/ceph-weeklies/fedora-rawhide-x86_64/00836454-ceph/builder-live.log

#5 Updated by Lenz Grimmer 7 months ago

Unfortunately it seems as if the Cython developers have no intentions to revert this breaking change - we will have to figure out an alternative solution:

https://mail.python.org/pipermail/cython-devel/2018-December/thread.html#5233

#6 Updated by Nathan Cutler 7 months ago

Brad Hubbard wrote:

This breaks building on fedora rawhide (fc30) where only 0.29.1-1.fc30 is available.

https://copr-be.cloud.fedoraproject.org/results/badone/ceph-weeklies/fedora-rawhide-x86_64/00836454-ceph/builder-live.log

Hi Brad: You're right that the addition of "Cython < 0.29" to the spec file broke the Fedora build, but it was a choice between that and letting distros build a broken mgr (see Ricardo's bug description, above).

In Tumbleweed we had the same problem, and we overcame it by reverting Tumbleweed's Cython package to 0.28.5.

#7 Updated by Tim Serong 7 months ago

Lenz Grimmer wrote:

Unfortunately it seems as if the Cython developers have no intentions to revert this breaking change - we will have to figure out an alternative solution:

FWIW I'm poking around at this too, to see if I can think of some magic.

https://mail.python.org/pipermail/cython-devel/2018-December/thread.html#5233

Sage added a couple of good replies to that thread already, but somehow they're not yet visible in the list archives :-/

#8 Updated by Brad Hubbard 7 months ago

Nathan Cutler wrote:

Hi Brad: You're right that the addition of "Cython < 0.29" to the spec file broke the Fedora build, but it was a choice between that and letting distros build a broken mgr (see Ricardo's bug description, above).

I get that. It wasn't my intention to apportion blame or be overly critical of the solution but to simply add another detail to the tracker. Sorry if it came across as accusatory or overly critical.

In Tumbleweed we had the same problem, and we overcame it by reverting Tumbleweed's Cython package to 0.28.5.

Not sure I have the same influence on fedora's direction mate ;)

#9 Updated by Tim Serong 7 months ago

#10 Updated by Kefu Chai 7 months ago

  • Status changed from Verified to Resolved

#11 Updated by Mykola Golub 7 months ago

Shouldn't we consider this fix rather as a workaround and still keep the bug open? The cython developers tell us that what we are doing is not safe in general case and not supported, and we just remove the protection and continued doing this.

#12 Updated by Sebastian Wagner 5 months ago

  • Related to Bug #38407: Funny issues with python sub-interpreters added

#13 Updated by Sebastian Wagner 4 months ago

  • Duplicated by Bug #38788: ceph-mgr: ImportError: Interpreter change detected - this module can only be loaded into one interprer per process. added

#14 Updated by Tim Serong 3 months ago

  • Status changed from Resolved to Pending Backport
  • Backport set to mimic

#15 Updated by Kefu Chai 3 months ago

  • Pull request ID set to 25585

Shouldn't we consider this fix rather as a workaround and still keep the bug open? The cython developers tell us that what we are doing is not safe in general case and not supported, and we just remove the protection and continued doing this.

agreed. how about using this ticket for tracking the backport, and creating a copy of it for a proper fix in future?

#16 Updated by Nathan Cutler 3 months ago

  • Copied to Backport #39593: mimic: Cython 0.29 removed support for subinterpreters: raises "ImportError: Interpreter change detected ..." added

#17 Updated by Nathan Cutler 3 months ago

  • Duplicated by deleted (Bug #38788: ceph-mgr: ImportError: Interpreter change detected - this module can only be loaded into one interprer per process.)

#18 Updated by Nathan Cutler 3 months ago

  • Related to Bug #38788: ceph-mgr: ImportError: Interpreter change detected - this module can only be loaded into one interprer per process. added

Also available in: Atom PDF