[runtime][python] Support TaskManager reuse across Flink Agents jobs
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend, distributed-systems
Direzione di ricerca
Read #943 and #1281 first, then trace the Python runtime's dependency-generation lifecycle, function cache, and Pemja classloading and native-library ownership. Validate sequential Session job reuse, concurrent jobs, and recovery of one job while another remains active, including Application Mode. Done means jobs load their intended code and resources without stale imports, cross-job cache reuse, or cleanup disrupting active jobs, and the documented support boundary is updated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search before asking
- I searched existing issues. This tracks the broader cross-job lifecycle work deferred from #943 and #1281.
Description
Support multiple Flink Agents jobs that use the Python runtime reusing the same TaskManager JVM, either sequentially or concurrently. This includes Python jobs and Java jobs with Python components.
The scope includes:
- Multiple jobs submitted to a Session cluster.
- Multiple jobs launched by the same application in Application Mode.
The relevant boundary is reuse of the same TaskManager process. Separate applications with dedicated TaskManagers do not share this process state.
Background and known gaps
#943 addresses dependency-generation changes during failover of the same JobID. It explicitly leaves cross-job reuse and cleanup of process-global Python state outside its scope. #1281 reports consecutive-job startup failures, and #1282 documents the limitation and recommends restarting the Session cluster before submitting another job that uses the Python runtime.
The broader support work needs to address:
- Pemja classloading and native-library ownership. #1281 reproduced startup failures in successive Session jobs when the distribution JAR is not in
lib, includingNoSuchFieldException: loadedLibraryNamesandPyObject cannot be cast to PyObject. Loading Pemja parent-first avoided those failures in the reported tests, but does not establish cross-job support. - Python imports and dependency lifecycle. Job completion does not deactivate the job's dependency generation. A subsequent job importing the same package name can reuse an old module from
sys.modules, potentially executing stale code or accessing resources in a deleted dependency directory. - Function-cache isolation. The Python function cache is keyed by
(module, qualname), without job or dependency-generation identity, so different jobs can reuse the same cached function. - Coordination between active jobs. A dependency-generation refresh clears the process-wide function cache. As discussed in #943, this can interfere with another job's cache lookup and introduces a possible
KeyErrorrace. Cleanup must also preserve modules and paths still needed by active jobs.
The Session startup failures were reproduced in #1281. The concurrent-job race and Application Mode scenarios still need end-to-end validation; we should not assume the same classloading failure occurs in every deployment layout.
Expected outcome
Define and validate the supported cross-job lifecycle, including sequential reuse, concurrent execution, and recovery of one job while another remains active. Jobs should load their intended code and resources without stale imports, cross-job cache reuse, or cleanup interfering with other jobs. Update the documented support boundary once these guarantees are established.
This issue tracks the overall support gap; it does not prescribe a particular implementation or recommend a parent-first configuration as a complete workaround.
Priority
Minor. We have not yet seen a concrete user requirement for this capability. The report in #1281 came from local Quickstart validation, with no production use case reported. We therefore consider this a low-priority follow-up and can revisit its priority when concrete user scenarios emerge.
- Lingua principale
- Java
- Stelle
- 497
- Fork
- 193
- Merge medio
- 2g 21h
- PR unite (30g)
- 68
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/flink-agents
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/flink-agents#1480 ·
I maintainer di solito rispondono entro 2 giorni
-
[Tech Debt] Python cross-language e2e tests hardcode 0.4-SNAPSHOT tests jar and silently skipAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/flink-agents#1476 ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug][runtime] Trace Log loggers fail on a string trace-log.pretty-print valueForse già presa @Zhuoxi2000 l’ha presa 3 giorni fa. ApertaaffectVersion/0.4.0 bug fixVersion/0.4.1 fixVersion/1.0.0 priority/major
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/flink-agents#1463 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 45/100
apache/flink-agents#1482 ·
I maintainer di solito rispondono entro 2 giorni
-
[java][python][Azure OpenAI] Align token limit handling with max_completion_tokensForse già presa @samarthputhraya l’ha presa oggi. ApertaaffectVersion/0.4.0 bug priority/major
apache/flink-agents#1478 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/flink-agents
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
federicoiosue/Omni-Notes#1044 ·
-
Industrial Center Text TypoApertaBug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Terraform releases proxy leaves a temp folder behind on every cache refreshForse già presa @dhananjay6561 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
terrakube-io/terrakube#4069 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno