KG
05/22/2024, 5:58 PM<frozen runpy>:128: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour"
. Additional context: this error is from a pod running a kubernetsJob using a docker image from the base prefect image and my flow code.Marvin
05/22/2024, 5:59 PMDaskTaskRunner
, where the flow pod is removed immediately without proper cleanup, leading to orphaned pods. This kind of behavior may also provide clues into resource mismanagement that could lead to the runtime warning you're seeing.
Flow cancellation does not delete Dask Scheduler & Worker pods
3. Cloning Error: A related issue during the cloning step in deployments signifies that the same warning was displayed when re-running deployments, specifically showing resource mismanagement issues leading to unpredictable behavior/errors on subsequent runs.
Cloning Error during pull step
### Conclusion:
The error you encountered might be due to improper handling and closing of resources or modules within the environment, possibly exacerbated by specific deployment setups such as Kubernetes or Docker. Ensuring proper closure of resources, validating your installation setup, and keeping Prefect and its dependencies up-to-date could mitigate such issues.
If the issue persists, consider exploring your flow's lifecycle management and how resources are handled during that lifecycle, especially concerning pod management in Kubernetes or connections established during the flow run.