uranusjr commented on code in PR #75561:
URL: https://github.com/apache/airflow/pull/75561#discussion_r4385408548


##########
task-sdk/src/airflow/sdk/coordinators/_subprocess.py:
##########
@@ -781,28 +867,37 @@ def execute_task(
         read other files of the bundle, such as the JARs on a Java classpath. 
Any other task runs the
         artifact found by scanning the bundle that holds the artifacts.
 
-        :raises TaskLaunchError: when a native Dag file cannot run, before the 
runtime starts.
+        :raises TaskLaunchError: when the runtime cannot start: a native Dag 
file cannot run, the
+            artifact of any other task cannot be found or run, the artifact 
needs a supervisor schema
+            version that this worker's Task SDK does not support, or the 
runtime exits or times out
+            before it connects.
         """
         task_logger = logger or log
         rel_path = os.fspath(dag_rel_path)
-        is_native = self._is_native_dag_file(rel_path, bundle_info.name)
-        if is_native:
-            bundle = _resolve_task_bundle(bundle_info, task_logger)
-        else:
-            bundle = self._resolve_artifact_bundle(bundle_info, task_logger)
-        # Hold the version lock across start()/wait() so bundle cleanup cannot
-        # rmtree a version this task is still reading from, mirroring
-        # task_runner.main() for the Python task path.
-        with (
-            BundleVersionLock(bundle_name=bundle.name, 
bundle_version=bundle.version),
-            self._set_scan_roots([bundle.path]),
-        ):
-            if is_native:
-                command, subprocess_schema_version = 
self._build_native_task_command(
-                    what=what, bundle=bundle, rel_path=rel_path
-                )
-            else:
-                command, subprocess_schema_version = 
self._build_execute_task_command(what=what)
+        # The lock and the scan roots are entered under 
_raise_as_launch_error, so failing to enter
+        # them is reported as a launch failure too, but released only once 
wait() returns.

Review Comment:
   ```suggestion
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to