Conversation
abeizn
approved these changes
Sep 20, 2024
Contributor
|
🤖 Target: #release-v1.0 cherry pick finished successfully 🎉! |
d4x1
added a commit
that referenced
this pull request
Sep 20, 2024
Co-authored-by: Lynwee <1507509064@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
pr-type/bug-fix,pr-type/feature-development, etc.Summary
What does this PR do?
Panic when
ExecuteMigrationfails.Why?
ExecuteMigrationis regared as a function that will succeed always, because if it return an error, backend will panic directly.What problems can be solved?
In these code:
ExecuteMigrationwill return an error and the main program will go on.If there is a new migration script which will return an error when executing , user will have to process db migration.
When this API is called, it returns an error.
But errors are different.
The frist time, it will return from https://github.com/apache/incubator-devlake/blob/main/backend/server/services/init.go#L157.
The second and following times, it will return from https://github.com/apache/incubator-devlake/blob/main/backend/server/services/init.go#L146.
Users can never handle this expect for a reboot.
I think it's unreasonable and this PR just try to fix this.
Does this close any open issues?
There are some related issues #8018 #7992 , but this fix is not the root cause of them.
Screenshots
Include any relevant screenshots here.
It will not return
There is a migration in progress.The backend will panic and recover(by gin framework if it's in release mode) directly.Other Information
Any other information that is important to this PR.