Skip to content

Commit 50301c6

Browse files
committed
fix a potential issue
1 parent 96d9186 commit 50301c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ddtrace/contrib/internal/ray/patch.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,12 @@ def traced_wait(wrapped, instance, args, kwargs):
390390

391391

392392
def _job_supervisor_run_wrapper(method: Callable[..., Any]) -> Any:
393-
async def _traced_run_method(self: Any, *args: Any, _dd_ray_trace_ctx, **kwargs: Any) -> Any:
393+
async def _traced_run_method(self: Any, *args: Any, _dd_ray_trace_ctx=None, **kwargs: Any) -> Any:
394394
import ray.exceptions
395395

396396
from ddtrace.ext import SpanTypes
397397

398-
context = _TraceContext._extract(_dd_ray_trace_ctx)
398+
context = _TraceContext._extract(_dd_ray_trace_ctx) if _dd_ray_trace_ctx else None
399399
submission_id = os.environ.get(RAY_SUBMISSION_ID)
400400

401401
with long_running_ray_span(
@@ -567,6 +567,10 @@ def patch():
567567

568568
ray._datadog_patch = True
569569

570+
from ray.util.tracing import tracing_helper
571+
572+
tracing_helper._global_is_tracing_enabled = False
573+
570574
@ModuleWatchdog.after_module_imported("ray.actor")
571575
def _(m):
572576
_w(m.ActorHandle, "_actor_method_call", traced_actor_method_call)

0 commit comments

Comments
 (0)