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

[ENH] handle panics in query service #2375

Merged
merged 12 commits into from
Jun 19, 2024
Merged

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Jun 18, 2024

This PR adds a test to confirm Tonic handles panics in the simplest cases for the query node.

Panics within components are untested (I suspect they wouldn't be caught by this).

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

rust/worker/src/server.rs Outdated Show resolved Hide resolved
rust/worker/Cargo.toml Outdated Show resolved Hide resolved
rust/worker/src/server.rs Outdated Show resolved Hide resolved
service Debug {
rpc GetInfo(google.protobuf.Empty) returns (GetInfoResponse) {}
rpc TriggerPanic(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestions welcome for a cleaner way to do this, I just want a way to trigger a panic within a service from a test

@codetheweb codetheweb marked this pull request as ready for review June 18, 2024 23:47
}

service Debug {
rpc GetInfo(google.protobuf.Empty) returns (GetInfoResponse) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It this just so when testing manually you can check its up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need a handler that returns a successful response without panicking. Alternatively I could add a shoud_panic option to the request for TriggerPanic, or call a normal rpc route like QueryVectors

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thats fine makes sense

@codetheweb codetheweb requested a review from HammadB June 19, 2024 17:11
Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, just a nit on comments. Are we adding the panic hook in another PR?

@codetheweb
Copy link
Contributor Author

Are we adding the panic hook in another PR?

yep 👍

@codetheweb codetheweb enabled auto-merge (squash) June 19, 2024 18:27
@codetheweb codetheweb merged commit fc5df1f into main Jun 19, 2024
64 checks passed
@codetheweb codetheweb deleted the feat-query-service-panic-handling branch June 19, 2024 19:44
Anush008 pushed a commit to Anush008/chroma that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants