Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply gevent threading patch early and ensure unique workflow node execution IDs #12196

Conversation

laipz8200
Copy link
Member

@laipz8200 laipz8200 commented Dec 29, 2024

Summary

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

  1. Use a new UUID as the primary key of the workflow node execution record.
  2. Remove the version warning message.
  3. Make sure to apply patching before importing the app.
  4. Remove the threading utils file because Gevent does not only patch the threading module.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • 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

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🐞 bug Something isn't working labels Dec 29, 2024
@bowenliang123
Copy link
Contributor

bowenliang123 commented Dec 29, 2024

Forcibly applying gevent theading patch in all cases may cause the following consequences:

  1. failed to debug on local enviroment
  2. failed to start the worker service, when the gevent is not used as the execution pool workder class, eg. threads or processes.

Consider to ignore or check these situations please.

crazywoola
crazywoola previously approved these changes Dec 29, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 29, 2024
… node execution

Signed-off-by: -LAN- <laipz8200@outlook.com>
… patching directly in app.py

Signed-off-by: -LAN- <laipz8200@outlook.com>
@laipz8200 laipz8200 force-pushed the fix/apply-gevent-threading-patch-early-and-ensure-unique-workflow-node-execution-IDs branch from 6000a46 to d66a073 Compare December 29, 2024 13:54
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Dec 29, 2024
@laipz8200 laipz8200 changed the title fix: apply gevent threading patch early and ensure unique workflow no… fix: apply gevent threading patch early and ensure unique workflow node execution IDs Dec 29, 2024
@laipz8200 laipz8200 requested a review from crazywoola December 29, 2024 13:57
@laipz8200
Copy link
Member Author

Forcibly applying gevent theading patch in all cases may cause the following consequences:

1. failed to debug on local enviroment

2. failed to start the worker service, when the gevent is not used as the execution pool workder class, eg. threads or processes.

Consider to ignore or check these situations please.

Thanks for the suggestions, but I found we can only use the Gevent worker for now.

…pp.py

Signed-off-by: -LAN- <laipz8200@outlook.com>
@bowenliang123
Copy link
Contributor

bowenliang123 commented Dec 29, 2024

Alright. It's just a minor reminder for you, not a blocker issue anyway.
CELERY_WORKER_CLASS in api/entrypoint.sh of the api docker image is allowing usage of implementation classes other than gevent.

@laipz8200 laipz8200 merged commit d4b8482 into main Dec 31, 2024
8 checks passed
@laipz8200 laipz8200 deleted the fix/apply-gevent-threading-patch-early-and-ensure-unique-workflow-node-execution-IDs branch December 31, 2024 03:42
laipz8200 added a commit that referenced this pull request Dec 31, 2024
…de execution IDs (#12196)

Signed-off-by: -LAN- <laipz8200@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants