You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Streaming app requests are rejected when maximum concurrency is 1 #45037
I have searched for existing issues, including closed ones.
I am submitting this report in English.
Dify version
Development main at 4eef080524babe78d7dd2d14746ce6141ca5e526.
Cloud or Self Hosted
Cloud (test environment).
Steps to reproduce
Create a Workflow app with a Start node connected directly to an End node.
Set the app's maximum concurrent requests to 1.
Ensure there are no other active requests.
Run the workflow once in the editor using the streaming execution path.
Expected Behavior
The first request is accepted. A second request is rejected while the first stream is active, and a new request can be accepted after that stream finishes or closes.
Actual Behavior
The only request is rejected before the workflow starts:
Too many requests. Please try again later. The current maximum concurrent requests allowed for <app_id> is 1.
AppGenerateService._run_with_guardrails already calls RateLimit.enter. The Workflow and Advanced Chat streaming branches call rate_limit_context again with the same request ID, so the first request counts against itself. With a larger limit, the inner context also releases the slot before the response stream has been consumed.
The outer guard and RateLimitGenerator already own admission and cleanup. Removing the duplicate contexts preserves that lifecycle. The now-unused context helper can then be removed.
Activity