[PR #30428] feat: add stop event check #32814

Closed
opened 2026-02-21 20:52:07 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30428

State: closed
Merged: No


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #30390

here is a user log
log.txt

2025-12-31 14:05:06 2025-12-31 06:05:06.326 DEBUG [Thread-26 (_generate_worker)] [worker_pool.py:129]  - Stopping worker pool: 1 workers
2025-12-31 14:05:16 2025-12-31 06:05:16.333 DEBUG [Thread-26 (_generate_worker)] [execution_limits.py:110]  - Execution completed: 8 steps in 33.43 seconds

we can see here, wait about 10s

14:05:06.326  WorkerPool.stop()
                ├─ worker.stop() → _stop_event.set()
                └─ worker.join(timeout=10.0) # start wait
                    ↓
                    ↓ 
                    ↓ (possible node.run() iteration)
                    ↓
  14:05:16.333  join() # timeout
                ↓
                ↓ print "Execution completed"

so we need check the stop_event is set or not in the iteration

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/30428 **State:** closed **Merged:** No --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary fix #30390 here is a user log [log.txt](https://github.com/user-attachments/files/24392371/log.txt) ``` 2025-12-31 14:05:06 2025-12-31 06:05:06.326 DEBUG [Thread-26 (_generate_worker)] [worker_pool.py:129] - Stopping worker pool: 1 workers 2025-12-31 14:05:16 2025-12-31 06:05:16.333 DEBUG [Thread-26 (_generate_worker)] [execution_limits.py:110] - Execution completed: 8 steps in 33.43 seconds ``` we can see here, wait about 10s ``` 14:05:06.326 WorkerPool.stop() ├─ worker.stop() → _stop_event.set() └─ worker.join(timeout=10.0) # start wait ↓ ↓ ↓ (possible node.run() iteration) ↓ 14:05:16.333 join() # timeout ↓ ↓ print "Execution completed" ``` so we need check the stop_event is set or not in the iteration ## Screenshots | Before | After | |--------|-------| | ... | ... | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:52:07 -05:00
yindo closed this issue 2026-02-21 20:52:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32814