jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.63k stars 2.21k forks source link

fix: fix issue with same doc type in spawned processes #6062

Closed JoanFM closed 9 months ago

JoanFM commented 9 months ago

When multiple Executors inside a Flow have the same model and they are used as docker containers or using JINA_MP_START_METHOD=spawn there will be an exception when served via HTTP.

This PR fixes this issue by making sure that only one model instance is considered for the same model name.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (67c83c2) 76.05% compared to head (1c4b9d3) 75.94%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6062 +/- ## ========================================== - Coverage 76.05% 75.94% -0.12% ========================================== Files 145 145 Lines 13916 13925 +9 ========================================== - Hits 10584 10575 -9 - Misses 3332 3350 +18 ``` | [Flag](https://app.codecov.io/gh/jina-ai/jina/pull/6062/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [jina](https://app.codecov.io/gh/jina-ai/jina/pull/6062/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | `75.94% <30.00%> (-0.12%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/jina-ai/jina/pull/6062?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [...ve/runtimes/gateway/http\_fastapi\_app\_docarrayv2.py](https://app.codecov.io/gh/jina-ai/jina/pull/6062?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#diff-amluYS9zZXJ2ZS9ydW50aW1lcy9nYXRld2F5L2h0dHBfZmFzdGFwaV9hcHBfZG9jYXJyYXl2Mi5weQ==) | `0.00% <0.00%> (ø)` | | | [jina/serve/stream/\_\_init\_\_.py](https://app.codecov.io/gh/jina-ai/jina/pull/6062?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#diff-amluYS9zZXJ2ZS9zdHJlYW0vX19pbml0X18ucHk=) | `84.65% <37.50%> (-2.85%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/jina-ai/jina/pull/6062/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.