Skip to content

fix(python): remove hardcoded OTEL_LOG_LEVEL=DEBUG that caused stderr deadlocks#3377

Closed
SAY-5 wants to merge 1 commit intotriggerdotdev:mainfrom
SAY-5:fix/python-runscript-stderr-deadlock
Closed

fix(python): remove hardcoded OTEL_LOG_LEVEL=DEBUG that caused stderr deadlocks#3377
SAY-5 wants to merge 1 commit intotriggerdotdev:mainfrom
SAY-5:fix/python-runscript-stderr-deadlock

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 15, 2026

Per #3357, python.runScript() deadlocks any Python subprocess that writes more than ~64KB to stderr.

The previous implementation hardcoded OTEL_LOG_LEVEL: 'DEBUG' in the subprocess environment (line 100), which caused OTEL-aware Python libraries (mlflow, opentelemetry-sdk, etc.) to emit verbose debug-level logging to stderr during import. Once stderr exceeded the OS pipe buffer, the Python process blocked on its next write() syscall indefinitely — a silent, permanent hang with no error or timeout (unless maxDuration was set).

This PR removes that single line, bringing runScript() in line with run(), runInline(), and the streaming variants — none of which set OTEL_LOG_LEVEL. The original line was almost certainly leftover dev instrumentation that shipped accidentally.

A patch changeset is included.

Closes #3357

… deadlocks

Per triggerdotdev#3357, `python.runScript()` deadlocks any Python subprocess
that writes more than ~64KB to stderr. The previous implementation
hardcoded `OTEL_LOG_LEVEL: 'DEBUG'` in the subprocess environment,
which caused OTEL-aware Python libraries (mlflow, opentelemetry-sdk,
etc.) to emit verbose debug-level logs to stderr during import.

Once stderr exceeded the OS pipe buffer, the Python process would
block on its next `write()` syscall indefinitely — a silent,
permanent hang with no error or timeout (unless `maxDuration` was
set).

Remove the hardcoded `OTEL_LOG_LEVEL: 'DEBUG'`. This brings
`runScript()` in line with `run()`, `runInline()`, and the
streaming variants — none of which set `OTEL_LOG_LEVEL`. The
original line was almost certainly leftover dev instrumentation
that shipped accidentally.

Closes triggerdotdev#3357
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: de5c162

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@trigger.dev/python Patch
d3-chat Patch
references-d3-openai-agents Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
trigger.dev Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
@internal/sdk-compat-tests Patch
references-telemetry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0651c74c-c1ea-4a26-a8f8-d2da0e042a5d

📥 Commits

Reviewing files that changed from the base of the PR and between 097fab0 and de5c162.

📒 Files selected for processing (2)
  • .changeset/python-stderr-deadlock-fix.md
  • packages/python/src/index.ts

Walkthrough

This PR adds a changeset documenting a deadlock fix in @trigger.dev/python's runScript() method and removes the hardcoded OTEL_LOG_LEVEL: "DEBUG" environment variable from the Python subprocess execution. The environment variable was causing OTEL-aware Python libraries to emit excessive debug logs to stderr during import, which could exceed the OS pipe buffer capacity (~64KB), causing the Python subprocess to block indefinitely on stderr writes. The removal aligns the runScript() code path with other execution paths that do not force the debug log level.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Hi @SAY-5, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions bot closed this Apr 15, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: python.runScript() deadlocks when Python subprocess produces >64KB stderr output

1 participant