Skip to content

fix(dataset): CELERY_BROKER uses amqp rabbitmq. When adding document segments in batches and uploading large files, the status will always remain stuck at "In batch processing" #22709#23038

Merged
crazywoola merged 1 commit intolanggenius:mainfrom
zhaobingshuang:main
Jul 28, 2025

Conversation

@zhaobingshuang
Copy link
Copy Markdown
Contributor

Fixes #22709

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

The original "batch_create_segment_to_index_task" task would store all the contents of the file as the parameter "content" in the AMQP, and the size of the MQ message could be very large, even exceeding the "max_message_size" configuration of RabbitMQ, which could cause Celery to lose the task.
This modification changed the parameter of "batch_create_segment_to_index_task" from "content" to "upload_file_id". During the execution of the task, the file was downloaded and further processed to avoid large MQ messages.
If the Celery broker uses Redis, this modification can also prevent the occurrence of large Redis keys.

Screenshots

Before After
image image

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

…segments in batches and uploading large files, the status will always remain stuck at "In batch processing" #22709
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 28, 2025
@crazywoola crazywoola requested a review from JohnJyong July 28, 2025 06:05
@crazywoola crazywoola self-assigned this Jul 28, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 28, 2025
@crazywoola crazywoola merged commit 5c5f61b into langgenius:main Jul 28, 2025
8 checks passed
tutkun pushed a commit to tutkun/dify that referenced this pull request Aug 15, 2025
…segments in batches and uploading large files, the status will always remain stuck at "In batch processing" langgenius#22709 (langgenius#23038)
@dosubot dosubot bot mentioned this pull request Oct 2, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

2 participants