Freeze the resolved interpreter for child processes
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Comienza en src/C/context.jl y sigue cómo getpref_exe y CTX.which gestionan CondaPkg durante el inicio de procesos hijo. Verifica el comportamiento existente controlado por CI y las convenciones de preferencias; después, confirma que los procesos iniciados heredan el ejecutable resuelto sin volver a resolver CondaPkg y que un JULIA_PYTHONCALL_EXE establecido por el usuario permanece sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When PythonCall resolves its interpreter via CondaPkg, each child process that loads
PythonCall re-resolves the same CondaPkg environment from scratch. Spawn several at once —
e.g. Distributed workers for parallel data loading (MLUtils DataLoader(...; num_workers=N)
over a PythonCall-backed dataset) — and they serialize on CondaPkg's lock, spamming
CondaPkg: Waiting for lock to be freed and redoing work the parent already did.
PythonCall already has the fix, but gates it behind CI=true and flags it as a hack
(src/C/context.jl, v0.9.35):
# HACK: If we are using CondaPkg, prevent child processes from using it by explicitly
# setting the executable. ...
# A better solution may be to use some environment variable to "freeze" CondaPkg in
# child processes.
# Only done when CI=true since it's a hack.
if (get(ENV, "CI", "false") == "true") && (CTX.which === :CondaPkg)
ENV["JULIA_PYTHONCALL_EXE"] = CTX.exe_path::String
end
Since JULIA_PYTHONCALL_EXE is exactly the "freeze" env var the comment asks for (child
processes inherit ENV, and getpref_exe reads it), the same line solves the general case.
Proposal
Set JULIA_PYTHONCALL_EXE whenever CTX.which === :CondaPkg, not only under CI — ideally
behind a preference (e.g. freeze_child_processes, default true) so it can be disabled.
get! already leaves a user-set value untouched.
Workaround
A downstream package can do this itself after init:
if PythonCall.C.CTX.which === :CondaPkg
get!(ENV, "JULIA_PYTHONCALL_EXE", PythonCall.python_executable_path()::String)
end
I've done this in https://github.com/JuliaGenAI/HuggingFaceDatasets.jl/pull/64
- Lenguaje dominante
- Julia
- Estrellas
- 1.1k
- Forks
- 89
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 7
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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.
Más de JuliaPy/PythonCall.jl
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
JuliaPy/PythonCall.jl#828 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
JuliaPy/PythonCall.jl#809 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Locking julia dependenciesAbiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
JuliaPy/PythonCall.jl#805 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
JuliaPy/PythonCall.jl#790 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
JuliaPy/PythonCall.jl#765 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de JuliaPy/PythonCall.jl
Issues similares
-
Chains resumed from `initial_state` take `num_warmup + 1` warm-up stepsPosiblemente ocupada @thevolatilebit la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
TuringLang/AbstractMCMC.jl#220 ·
-
found-by-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
exanauts/SparseDirectSolver.jl#92 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
NumericalEarth/Breeze.jl#1051 ·
Los mantenedores suelen responder en 1 día
-
lu_instance/qr_instance run a full factorization for FixedSizeArraysPosiblemente ocupada @devmotion la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JuliaArrays/ArrayInterface.jl#510 ·