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

Add OTP request timeout GraphQL instrumentation #5881

Conversation

vpaturet
Copy link
Contributor

@vpaturet vpaturet commented May 30, 2024

Summary

The OTP request timeout feature provides a way to periodically check if the thread running an API request has been interrupted at a higher level (web server level).
This allows for cancelling long-running queries.
However this assumes that the running query will touch the code that checks for the interruption status.
While this works well for trip planning queries, other categories of query may never touch the check points.

This PR adds an extra level of protection by checking periodically the OTP request timeout status at the GraphQL level, while data is being fetched.

Issue

No.

Unit tests

No.

Documentation

No.

@vpaturet vpaturet added Improvement Entur Test This is currently being tested at Entur labels May 30, 2024
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 68.48%. Comparing base (715be85) to head (ec4baa3).

Files Patch % Lines
...s/transmodel/OTPRequestTimeoutInstrumentation.java 0.00% 8 Missing ⚠️
...entripplanner/apis/transmodel/TransmodelGraph.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5881      +/-   ##
=============================================
- Coverage      68.49%   68.48%   -0.02%     
  Complexity     16703    16703              
=============================================
  Files           1915     1916       +1     
  Lines          72652    72660       +8     
  Branches        7447     7448       +1     
=============================================
- Hits           49762    49760       -2     
- Misses         20325    20335      +10     
  Partials        2565     2565              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vpaturet vpaturet force-pushed the add_otp_request_timeout_graphql_instrumentation branch from 99770d4 to ec4baa3 Compare May 30, 2024 12:41
@vpaturet vpaturet marked this pull request as ready for review May 30, 2024 13:39
@vpaturet vpaturet requested a review from a team as a code owner May 30, 2024 13:39
@vpaturet vpaturet self-assigned this May 30, 2024
Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

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

If it's good enough for Entur, it's good enough for me.

@vpaturet vpaturet merged commit ba67f17 into opentripplanner:dev-2.x May 31, 2024
5 checks passed
@vpaturet vpaturet deleted the add_otp_request_timeout_graphql_instrumentation branch May 31, 2024 09:11
t2gran pushed a commit that referenced this pull request May 31, 2024
@t2gran t2gran added this to the 2.6 (next release) milestone Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Entur Test This is currently being tested at Entur Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants