HTTPS trace exports can time out after a proxy TLS handshake fails

Open
#46,987 0 comments 1 reaction 1 assignee View on GitHub

Maintainers usually reply within 1 day

@laipz8200 is already working on this.

Since Nov 24, 2026.

  • #47012 by @ZombieBlue — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
networking

Research direction

Start by reading upstream httpcore PR 1087 to see exactly what the proxy-connection cleanup changes on TLS setup failure, then locate the temporary httpcore pin in Dify's Python dependency manifest and the outbound HTTPX client configuration the worker uses. Reproduce the leak by pointing the client at a proxy and forcing certificate rejection and handshake timeout, then confirm a following valid request succeeds. Done means the cleanup is in place with tests covering both error classes, tracing delivery and retry semantics unchanged, and diagnostics that omit request data; the pin stays until a release ships the fix.

Written by the indexing model from the issue text.

Description

project#dify

Symptoms

A tracing worker can report Destination unreachable for a healthy HTTPS collector. The export times out while waiting for a connection inside the worker, before the proxy receives a new request.

Root cause

In httpcore 1.0.9, the proxy can accept CONNECT and the subsequent TLS handshake with the collector can still fail. The network stream closes its socket, but the tunnel continues to report its connection as active. The pool removes the failed request and keeps counting the unusable connection. Tunnel handling · Pool cleanup

Dify reuses this pool across HTTPS trace exports in the same worker process. When the pool has no free slot, a later export can raise PoolTimeout. The tracing layer groups that exception with other connection errors and reports Destination unreachable. Client reuse · Tracing error handling

Dominant language
Python
Stars
162k
Forks
25.6k
Avg merge
15h 9m
Merged PRs (30d)
606

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from langgenius/dify

All issues in langgenius/dify

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.