Some Runtime Finalization Constraints Are Not Enforced Nor Documented
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 36k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug report
Bug description:
There are a few technical constraints on calling Py_Finalize() currently aren't enforced, well-documented, or widely recognized. This is partly due to the relatively small number of embedders and the even smaller number of them that might violate the constraints through the use of threads or subinterpreters.
The constraints are:
- should be called only in the main thread
- should be called only with the main interpreter active
- should be called only using the same thread state used for
Py_Initialize()
(That last one is potentially less critical.)
There are several reasons these matter:
- the main thread of the main interpreter has a special role in the runtime's lifecycle
- the main thread of the main interpreter has unique responsibilities that must be synchronized with finalization
- conceptually, runtime lifecycle is an app-level function, and the app is typically driven through the "main" thread
The constraints should be documented, tested, and (possibly) enforced.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-120839
- gh-120840
- gh-120841
- gh-120852
- gh-120853
- gh-121010
- gh-121013
- gh-121063
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza rastreando el punto de entrada Py_Finalize() y revisa los PR enlazados gh-120839, gh-120840, gh-120841, gh-120852, gh-120853, gh-121010, gh-121013 y gh-121063. Se considera completado cuando las restricciones del hilo principal, del intérprete principal y del estado del hilo de inicialización estén documentadas, cubiertas por pruebas y posiblemente se hagan cumplir.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 20/100