You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vatsrahul1001 (via GitHub)" <gi...@apache.org> on 2024/07/26 14:20:17 UTC
[I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
vatsrahul1001 opened a new issue, #41055:
URL: https://github.com/apache/airflow/issues/41055
### Apache Airflow version
2.10.0b1
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
Tasks are stuck in the scheduled state when `AIRFLOW__CORE__PARALLELISM=0`(unlimited parallelism). In Perious airflow version its working fine
### What you think should happen instead?
_No response_
### How to reproduce
Create a deployment using k8s executor with 2.10.0b1 and try executing any task
### Operating System
Linux
### Versions of Apache Airflow Providers
_No response_
### Deployment
Astronomer
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "shubham22 (via GitHub)" <gi...@apache.org>.
shubham22 commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2253340939
@vatsrahul1001 - do we actually document that 0 is unlimited parallelism? From product point of view, I don't think we need to actually support it. It is always a good idea to cap parallelism and if a user wants unlimited, they can set it to a really large number. I don't see a reason why we need to keep support for "0" as it is not intuitive.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas closed issue #41055: Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor
URL: https://github.com/apache/airflow/issues/41055
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2256264249
> Hi @o-nikolas , in the base executor, it's described that setting the parallelism to '0' means infinite parallelism. See :
>
> https://github.com/apache/airflow/blob/c0cc614b2d494d610431fc2796388b86b64af731/airflow/executors/base_executor.py#L113
>
> The LocalExecutor specifically implemented this unlimited parallelism see:
>
> https://github.com/apache/airflow/blob/9468a72b75c2880f032f654165012a9f66b83fbf/airflow/executors/local_executor.py#L388
>
> Another evidence that it can be set to `0` is
>
> https://github.com/apache/airflow/blob/9468a72b75c2880f032f654165012a9f66b83fbf/airflow/executors/local_executor.py#L233
>
> So I believe this to be a breaking change
@ephraimbuddy
Thanks for the reply! Yupp, there are snippets of proof on both sides. I'm aware of the code in the base exec and local executor. But also this feature is undocumented, untested, some metrics break when you use it, etc. So as I said originally, it's a half-baked feature.
> my 2c: I think there is a valid case for the infinite/unknown parallelism for KE. For example, if we have a cluster with some capacity X Gi of memory, now how do we decide the optimal parallelism in such scenarios?
@utkarsharma2 thanks for the reply!
There is nothing stopping you from setting parallelism to 100000 if you're not sure. But I think forcing folks to take a minute to think through what their parallelism _should be_ is a useful exercise. Airflow performance can degrade quite quickly if you let any of the many adjustment knobs get too far out of a good performance band (e.g. if you have noisy DAGs and set parallelism to infinity, you may choke your scheduler or workers with too many tasks concurrently).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2255361998
Hi @o-nikolas , in the base executor, it's described that setting the parallelism to '0' means infinite parallelism. See : https://github.com/apache/airflow/blob/c0cc614b2d494d610431fc2796388b86b64af731/airflow/executors/base_executor.py#L113
The LocalExecutor specifically implemented this unlimited parallelism see: https://github.com/apache/airflow/blob/9468a72b75c2880f032f654165012a9f66b83fbf/airflow/executors/local_executor.py#L388
Another evidence that it can be set to `0` is https://github.com/apache/airflow/blob/9468a72b75c2880f032f654165012a9f66b83fbf/airflow/executors/local_executor.py#L233
So I believe this to be a breaking change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2256269128
All that too say though, I'm happy to disagree and commit :slightly_smiling_face: I can add the infinity to the scheduler code, but suppose that I'd at least ask that someone here who is arguing that we keep this feature take on writing the docs, tests, and patch up some of the metrics.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "utkarsharma2 (via GitHub)" <gi...@apache.org>.
utkarsharma2 commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2254177871
my 2c: I think there is a valid case for the infinite/unknown parallelism for KE. For example, if we have a cluster with some capacity X Gi of memory, now how do we decide the optimal parallelism in such scenarios? We can defer it to the Kubernetes scheduler to do it. As it totally depends on the resource requirement of the task, the X could be distributed say, X / 10 or X / 20 or even non-uniformly across pods. However, IMO we can default it to -1 in such cases instead of 0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2257018162
> All that too say though, I'm happy to disagree and commit 🙂 I can add the infinity to the scheduler code, but suppose that I'd at least ask that someone here who is arguing that we keep this feature take on writing the docs, tests, and patch up some of the metrics.
We might not patch up or do all the necessary documentation or testing for this, but I can help make it unlimited parallelism. I just feel that we shouldn't break this at the tail end of Airflow 2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2253112138
> cc @o-nikolas . It seems related to your PR on multi-executors #40017 and is a breaking change
Sure @ephraimbuddy, I will try replicate the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2252884635
cc @o-nikolas . It seems related to your PR on multi-executors https://github.com/apache/airflow/pull/40017 and is a breaking change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "amrit2196 (via GitHub)" <gi...@apache.org>.
amrit2196 commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2364253069
I am facing a similar issue, we had upgraded our airflow version to 2.10 from 2.5.3, here the tasks pods are getting stuck in scheduled after a certain period of time when it reaches the open slot count for parallelism, in our case it is set to 32 , so when 32 plus tasks run, then whatever tasks comes up get stuck in scheduled state, even though the previous tasks are cleared, it still shows that the open slot count as zero
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2253322717
Just to add to that, the metrics code will also log this when parallelism is set to 0. So multiple things need to be fixed if we wish to support this:
> INFO - Executor parallelism limit reached. 0 open slots.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2257009505
> @ephraimbuddy
Thanks for the reply! Yupp, there are snippets of proof on both sides. I'm aware of the code in the base exec and local executor. But also this feature is undocumented, untested, some metrics break when you use it, etc. So as I said originally, it's a half-baked feature.
I agree with you that it's half-baked, but we currently don't know how many people depend on this unlimited parallelism. It is not documented and untested, but it has existed for years. I don't support dropping it. I think we should keep it at least for Airflow 2.10 and break it in Airflow 3 since we are heading to 3 now. People might not know at a glance why their deployment is not running any task. It might take them time to debug and find that it's their parallelism setting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2257029091
@ephraimbuddy fair enough, just posted a PR here: #41107 :slightly_smiling_face:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "benrifkind (via GitHub)" <gi...@apache.org>.
benrifkind commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2433165972
> I am facing a similar issue, we had upgraded our airflow version to 2.10 from 2.5.3, here the tasks pods are getting stuck in scheduled after a certain period of time when it reaches the open slot count for parallelism, in our case it is set to 32 , so when 32 plus tasks run, then whatever tasks comes up get stuck in scheduled state, even though the previous tasks are cleared, it still shows that the open slot count as zero
I believe I am seeing this issue as well. I upgraded from Airflow 2.6.3 to 2.10.2. I am running Airflow on kubernetes using the CeleryExecutor with two schedulers and core parallelism set to 64. At some point overnight one of the Airflow scheduler pods just maxed out at 64 and gets stuck there

If I look at the logs for this scheduler I see many lines like
```
[2024-10-23T18:47:56.591+0000] {base_executor.py:292} INFO - Executor parallelism limit reached. 0 open slots.
[2024-10-23T18:47:57.725+0000] {base_executor.py:292} INFO - Executor parallelism limit reached. 0 open slots.
....
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Tasks are stuck in scheduled state when AIRFLOW__CORE__PARALLELISM env is set to 0 in Kubernetes Executor [airflow]
Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on issue #41055:
URL: https://github.com/apache/airflow/issues/41055#issuecomment-2253320678
@ephraimbuddy
I was able to reproduce this with another executor (SequentialExecutor) and I get the same behaviour. I looked more closely at our docs and configuration reference and it does not actually say that parallelism=0 means infinite scheduling:
> This defines the maximum number of task instances that can run concurrently per scheduler in Airflow, regardless of the worker count. Generally this value, multiplied by the number of schedulers in your cluster, is the maximum number of task instances with the running state in the metadata database.
There are no tests that assert this either (at least none that are failing as of now). So I believe this was working as an infinity kind of as a half-baked non-feature previously. So right now the code is behaving as expected. You told it that zero tasks can run concurrently so it is respecting that, and well, running zero tasks. We'll need to decide if we want to support this case more generally/officially. Tagging some folks to join in on the conversation: @eladkal @potiuk
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org