-
Notifications
You must be signed in to change notification settings - Fork 153
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: server crash when accepting improper resource create request #374
Conversation
Pull Request Test Coverage Report for Build 2425899844
💛 - Coveralls |
a6669ac
to
e72edc7
Compare
@@ -442,14 +443,24 @@ func ToResourceProto(spec models.ResourceSpec) (*pb.ResourceSpecification, error | |||
} | |||
|
|||
func FromResourceProto(spec *pb.ResourceSpecification, storeName string, datastoreRepo models.DatastoreRepo) (models.ResourceSpec, error) { | |||
if spec == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irainia cmiiw, because these flows are not handled, it is panicing and server is crashing is it? Just want to check ideally the panic should just kill the goroutine handling the request not the entire server, can we cross check on this, as this means this issue can happen even in the future for all unhandled scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sravankorumilli , yes, it cashed because of panic. But, we didn't explicitly call any go routine to run it (such as this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated and tested based on the suggestion
LGTM, although seeing a similar issue on job creation. We can consider fixing that in this or new PR should also be fine. |
This PR is to address #352 . Even though the issue only mentioned about resource creation, but this solution should also address the same for updating resource. This is because the update process is similar to the creation.
Changes
The followings are the changes done:
Improvement
Based on this PR, there are some TODO that can be addressed through separate cards, as the changes might be bigger.