Revert "Remove while loop from check_service" #1817
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 46d2863.
I was able to find the issue that caused the threads to be stuck in the production. It was caused by some deadlock in the database, operations waiting on each other. I'm not sure what caused it, but after removing the locks the processing is working again and there wasn't any thread stuck till then.
Also this change is causing errors to happen when tested on staging. From the first look it seems to be caused by simultaneous access to the database for insert operation, but as the original code is working and the issue wasn't caused by it I'm reverting this commit.