[Asyncio] Increase recursion limit manually (#7142)

This commit is contained in:
Simon Mo
2020-02-12 14:15:36 -08:00
committed by GitHub
parent f41a9b9813
commit 0e94e1dc2a
2 changed files with 52 additions and 29 deletions
+15
View File
@@ -3,6 +3,8 @@
# cython: embedsignature = True
# cython: language_level = 3
from cpython.pystate cimport PyThreadState_Get
from libcpp cimport bool as c_bool
from libcpp.string cimport string as c_string
from libcpp.vector cimport vector as c_vector
@@ -24,6 +26,19 @@ from ray.includes.function_descriptor cimport (
CFunctionDescriptor,
)
cdef extern from "Python.h":
# Note(simon): This is used to configure asyncio actor stack size.
# Cython made PyThreadState an opaque types. Saying that if the user wants
# specific attributes, they can be declared manually.
# You can find the cpython definition in Include/cpython/pystate.h#L59
ctypedef struct CPyThreadState "PyThreadState":
int recursion_depth
# From Include/ceveal.h#67
int Py_GetRecursionLimit()
void Py_SetRecursionLimit(int)
cdef class Buffer:
cdef:
shared_ptr[CBuffer] buffer