Skip to content

Fix Worker crash on API Server Error - #48517

Merged
kaxil merged 1 commit into
apache:mainfrom
astronomer:fix-pickle-error
Mar 28, 2025
Merged

kaxil merged 1 commit into
apache:mainfrom
astronomer:fix-pickle-error

Conversation

@kaxil

@kaxil kaxil commented Mar 28, 2025 •

Copy link
Copy Markdown
Member

closes #47873

closes #48503

The error comes from LocalExecutor, specifically the following block:

try:
_execute_work(log, workload)
output.put((key, TaskInstanceState.SUCCESS, None))
except Exception as e:
log.exception("uhoh")
output.put((key, TaskInstanceState.FAILED, e))

When a task fails with an exception, the exception is put into the result_queue as part of a tuple with the task key and state.

Later, in _read_results, the executor tries to read from this queue, and it fails!!:

def _read_results(self):
while not self.result_queue.empty():
key, state, exc = self.result_queue.get()

Before:

The scheduler with LocalExecutor fails and exits with the following error. This was because ServerResponseError isn't picklable and httpx maintainers haven't merged encode/httpx#3108.

The task stays in running state
:

image image image
2025-03-28 22:31:18 [warning  ] Server error                   [airflow.sdk.api.client] detail={'message': 'Internal server error', 'correlation-id': '0195dee1-8af3-7cd2-9c14-e54b668c31bf'}
[2025-03-28T22:31:18.924+0000] {local_executor.py:96} ERROR - uhoh
Traceback (most recent call last):
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 92, in _run_worker
    _execute_work(log, workload)
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 113, in _execute_work
    supervise(
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 1159, in supervise
    exit_code = process.wait()
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 730, in wait
    self._monitor_subprocess()
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 788, in _monitor_subprocess
    alive = self._service_subprocess(max_wait_time=max_wait_time) is None
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 625, in _service_subprocess
    need_more = socket_handler(key.fileobj)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 1010, in cb
    gen.send(line)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 514, in handle_requests
    self._handle_request(msg, log)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 948, in _handle_request
    dagrun_resp = self.client.task_instances.get_previous_successful_dagrun(self.id)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 195, in get_previous_successful_dagrun
    resp = self.client.get(f"task-instances/{id}/previous-successful-dagrun")
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1054, in get
    return self.request(
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 418, in exc_check
    raise retry_exc.reraise()
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 185, in reraise
    raise self.last_attempt.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 538, in request
    return super().request(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 827, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 999, in _send_handling_redirects
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 982, in _send_handling_redirects
    hook(response)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 107, in raise_on_4xx_5xx
    return get_json_error(response) or response.raise_for_status()
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 103, in get_json_error
    raise err
airflow.sdk.api.client.ServerResponseError: Server returned error
[2025-03-28T22:31:19.022+0000] {scheduler_job_runner.py:938} ERROR - Exception when executing SchedulerJob._run_scheduler_loop
Traceback (most recent call last):
  File "/opt/airflow/airflow-core/src/airflow/jobs/scheduler_job_runner.py", line 934, in _execute
    self._run_scheduler_loop()
  File "/opt/airflow/airflow-core/src/airflow/jobs/scheduler_job_runner.py", line 1073, in _run_scheduler_loop
    executor.heartbeat()
  File "/opt/airflow/airflow-core/src/airflow/traces/tracer.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/executors/base_executor.py", line 280, in heartbeat
    self.sync()
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 205, in sync
    self._read_results()
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 210, in _read_results
    key, state, exc = self.result_queue.get()
  File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 367, in get
    return _ForkingPickler.loads(res)
TypeError: ServerResponseError.__init__() missing 2 required keyword-only arguments: 'request' and 'response'
[2025-03-28T22:31:19.023+0000] {local_executor.py:216} INFO - Shutting down LocalExecutor; waiting for running tasks to finish.  Signal again if you don't want to wait.
[2025-03-28T22:31:19.027+0000] {scheduler_job_runner.py:950} INFO - Exited execute loop
[2025-03-28 22:31:19 +0000] [341] [INFO] Handling signal: term
[2025-03-28 22:31:19 +0000] [342] [INFO] Worker exiting (pid: 342)
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 10, in <module>
    sys.exit(main())
  File "/opt/airflow/airflow-core/src/airflow/__main__.py", line 58, in main
    args.func(args)
  File "/opt/airflow/airflow-core/src/airflow/cli/cli_config.py", line 49, in command
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 111, in wrapper
    return f(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/utils/providers_configuration_loader.py", line 55, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/scheduler_command.py", line 52, in scheduler
    run_command_with_daemon_option(
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/daemon_utils.py", line 86, in run_command_with_daemon_option
    callback()
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/scheduler_command.py", line 55, in <lambda>
    callback=lambda: _run_scheduler_job(args),
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/scheduler_command.py", line 43, in _run_scheduler_job
    run_job(job=job_runner.job, execute_callable=job_runner._execute)
  File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 101, in wrapper
    return func(*args, session=session, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/jobs/job.py", line 348, in run_job
    return execute_job(job, execute_callable=execute_callable)
  File "/opt/airflow/airflow-core/src/airflow/jobs/job.py", line 377, in execute_job
    ret = execute_callable()
  File "/opt/airflow/airflow-core/src/airflow/jobs/scheduler_job_runner.py", line 934, in _execute
    self._run_scheduler_loop()
  File "/opt/airflow/airflow-core/src/airflow/jobs/scheduler_job_runner.py", line 1073, in _run_scheduler_loop
    executor.heartbeat()
  File "/opt/airflow/airflow-core/src/airflow/traces/tracer.py", line 54, in wrapper
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/executors/base_executor.py", line 280, in heartbeat
    self.sync()
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 205, in sync
    self._read_results()
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 210, in _read_results
    key, state, exc = self.result_queue.get()
  File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 367, in get
    return _ForkingPickler.loads(res)
TypeError: ServerResponseError.__init__() missing 2 required keyword-only arguments: 'request' and 'response'
[2025-03-28 22:31:19 +0000] [343] [INFO] Worker exiting (pid: 343)
[2025-03-28 22:31:19 +0000] [341] [INFO] Shutting down: Master

After:

The worker continues execution and marks the current task as failed.

image
[2025-03-28T22:27:44.731+0000] {_client.py:1026} INFO - HTTP Request: GET http://localhost:8080/execution/task-instances/0195dedc-dd4e-7b99-a42f-6c46a55e8ebd/previous-successful-dagrun "HTTP/1.1 500 Internal Server Error"
2025-03-28 22:27:44 [warning  ] Server error                   [airflow.sdk.api.client] detail={'message': 'Internal server error', 'correlation-id': '0195dede-4676-7de6-b57f-b65c2d632deb'}
[2025-03-28T22:27:44.732+0000] {local_executor.py:96} ERROR - uhoh
Traceback (most recent call last):
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 92, in _run_worker
    _execute_work(log, workload)
  File "/opt/airflow/airflow-core/src/airflow/executors/local_executor.py", line 113, in _execute_work
    supervise(
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 1159, in supervise
    exit_code = process.wait()
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 730, in wait
    self._monitor_subprocess()
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 788, in _monitor_subprocess
    alive = self._service_subprocess(max_wait_time=max_wait_time) is None
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 625, in _service_subprocess
    need_more = socket_handler(key.fileobj)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 1010, in cb
    gen.send(line)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 514, in handle_requests
    self._handle_request(msg, log)
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 948, in _handle_request
    dagrun_resp = self.client.task_instances.get_previous_successful_dagrun(self.id)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 195, in get_previous_successful_dagrun
    resp = self.client.get(f"task-instances/{id}/previous-successful-dagrun")
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1054, in get
    return self.request(
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 418, in exc_check
    raise retry_exc.reraise()
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 185, in reraise
    raise self.last_attempt.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 538, in request
    return super().request(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 827, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 999, in _send_handling_redirects
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 982, in _send_handling_redirects
    hook(response)
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 107, in raise_on_4xx_5xx
    return get_json_error(response) or response.raise_for_status()
  File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 103, in get_json_error
    raise err
airflow.sdk.api.client.ServerResponseError: Server returned error
[2025-03-28T22:27:45.740+0000] {scheduler_job_runner.py:752} INFO - Received executor event with state failed for task instance TaskInstanceKey(dag_id='context_full_test_dag', task_id='print_context', run_id='manual__2025-03-28T22:26:11.395841+00:00_mw5XAc9F', try_number=2, map_index=-1)
[2025-03-28T22:27:45.747+0000] {scheduler_job_runner.py:794} INFO - TaskInstance Finished: dag_id=context_full_test_dag, task_id=print_context, run_id=manual__2025-03-28T22:26:11.395841+00:00_mw5XAc9F, map_index=-1, run_start_date=2025-03-28 22:27:39.943960+00:00, run_end_date=None, run_duration=None, state=running, executor=LocalExecutor(parallelism=32), executor_state=failed, try_number=2, max_tries=0, pool=default_pool, queue=default, priority_weight=1, operator=_PythonDecoratedOperator, queued_dttm=2025-03-28 22:27:39.682231+00:00, scheduled_dttm=2025-03-28 22:27:39.666751+00:00,queued_by_job_id=368, pid=301
[2025-03-28T22:27:45.751+0000] {taskinstance.py:3095} ERROR - Executor LocalExecutor(parallelism=32) reported that the task instance <TaskInstance: context_full_test_dag.print_context manual__2025-03-28T22:26:11.395841+00:00_mw5XAc9F [running]> finished with state failed, but the task instance's state attribute is running. Learn more: https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ashb ashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean okay, but what is actually using pickle in our path?

What is trying to pickle the exception in the first place

@kaxil

kaxil commented Mar 28, 2025

Copy link
Copy Markdown
Member Author

I mean okay, but what is actually using pickle in our path?

What is trying to pickle the exception in the first place

It is coming from Local Executor, specifically the following block:

try:
_execute_work(log, workload)
output.put((key, TaskInstanceState.SUCCESS, None))
except Exception as e:
log.exception("uhoh")
output.put((key, TaskInstanceState.FAILED, e))

When a task fails with an exception, the exception is put into the result_queue as part of a tuple with the task key and state.

Later, in _read_results, the executor tries to read from this queue, and it fails!!:

def _read_results(self):
while not self.result_queue.empty():
key, state, exc = self.result_queue.get()

@kaxil
kaxil force-pushed the fix-pickle-error branch from a46e427 to def4b79 Compare March 28, 2025 22:49
@kaxil

kaxil commented Mar 28, 2025

Copy link
Copy Markdown
Member Author

This should hold us for now, I have another fix in mind -- just a little more involved

@kaxil
kaxil merged commit aee7ad2 into apache:main Mar 28, 2025
1 check passed
@kaxil
kaxil deleted the fix-pickle-error branch March 28, 2025 23:23

@amoghrajesh amoghrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goodness, good catch!

kaxil added a commit to astronomer/airflow that referenced this pull request Mar 31, 2025
Follow-up of apache#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.
kaxil added a commit that referenced this pull request Mar 31, 2025
Follow-up of #48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by #48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.
shubham-pyc pushed a commit to shubham-pyc/airflow that referenced this pull request Apr 2, 2025
shubham-pyc pushed a commit to shubham-pyc/airflow that referenced this pull request Apr 2, 2025
)

Follow-up of apache#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 29, 2025
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 24, 2025
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 22, 2025
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Feb 27, 2026
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
Comment on lines +894 to +921
# def test_server_response_error_pickling():
# """Test that ServerResponseError can be pickled and unpickled."""
# def handle_request(request: httpx.Request) -> httpx.Response:
# return httpx.Response(
# status_code=400,
# request=request,
# json={"detail": {"message": "Invalid input"}},
# )
#
# client = make_client(transport=httpx.MockTransport(handle_request))
#
# # Create an error by making a request that will fail
# with pytest.raises(ServerResponseError) as exc_info:
# client.get("http://fake-url-for-testing")
#
# err = exc_info.value
#
# # Pickle and unpickle
# pickled = pickle.dumps(err)
# unpickled = pickle.loads(pickled)
#
# assert isinstance(unpickled, ServerResponseError)
#
# # Error message from response
# assert unpickled.response.json() == {"detail": {"message": "Invalid input"}}
# assert unpickled.detail == {"detail": {"message": "Invalid input"}}
# assert unpickled.response.status_code == 400
# assert unpickled.request.url == "http://fake-url-for-testing"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed

@potiuk potiuk mentioned this pull request Apr 4, 2026
1 of 2 tasks
@jguthrie100

Copy link
Copy Markdown

Has this already been released in a production release? I'm getting the same error running Airflow 3.2.1

kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jul 28, 2026
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jul 30, 2026
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
ColtenOuO added a commit to ColtenOuO/airflow that referenced this pull request Aug 22, 2026
get_json_error() only wraps 400-599 responses in the picklable
ServerResponseError (it needs a custom __reduce__ because plain
httpx.HTTPStatusError requires keyword-only request/response arguments
pickle's default reconstruction can't supply -- see apache#47873, fixed for
that path by apache#48517). A 3xx response -- e.g. a corporate proxy in
front of the API server returning a redirect -- falls outside that
range, so httpx.Response.raise_for_status() raises the bare,
unpicklable httpx.HTTPStatusError instead.

That bare exception crashes the scheduler once it crosses a
multiprocessing boundary: LocalExecutor.result_queue is a
multiprocessing.Queue, and unpickling the exception on the scheduler
side fails with the exact "missing keyword-only arguments" TypeError
apache#47873 first reported, just triggered by a redirect instead of a
JSON error body.

_raise_for_status_picklable() now wraps anything raise_for_status()
raises outside the 400-599 range in a ServerResponseError too, while
leaving in-range errors that from_response() couldn't parse a JSON
detail from exactly as before.
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 5, 2026
Follow-up of apache/airflow#48517

Currently, when a task fails due to API Server error, the task logs shows nothing, and the task continues running.

It also leads to the pickling issue on LocalExecutor that was fixed by apache/airflow#48517.

This PR improves upon it and propogates the API server error in the task UI and fails the task.

GitOrigin-RevId: 02d251c6002f524c9a86da80a44687982c262698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants