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: timeout error while cancelling the Purchase Receipt #36289

Conversation

rohitwaghchaure
Copy link
Collaborator

Issue

While cancelling the Purchase Receipt, user were getting the timeout error.
After profiling came to know that system is taking 10 mins to submit the Purchase Receipt and causing the timeout error

Screenshot 2023-07-24 at 5 52 38 PM

Investigation

  • On cancellation of the Purchase Receipt, the system deletes the batches which were created against the respective Purchase Receipt.
  • While deleting batches, the system checks whether the batch has been linked to any document or not.
  • If the batch is linked to any document, then the system won't allow deleting that batch.
  • In the Processlist, it was found that the document "Sales Invoice Item, Delivery Note Item, Stock Reconciliation Item, Pick List Item" took a lot of time to check whether the respective batch is linked or not.

Solution

Added indexing for the batch_no column in the document "Sales Invoice Item, Delivery Note Item, Stock Reconciliation Item, Pick List Item". After that system has took 13 seconds to cancel the Purchase Receipt
Screenshot 2023-07-25 at 11 52 28 AM

@rohitwaghchaure rohitwaghchaure merged commit ab757cb into frappe:version-14-hotfix Jul 25, 2023
10 checks passed
@rohitwaghchaure rohitwaghchaure added the backport develop instructs mergify to frontport PR to develop branch label Jul 25, 2023
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport develop instructs mergify to frontport PR to develop branch released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants