opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.18k stars 1.02k forks source link

Add OTP request timeout GraphQL instrumentation #5881

Closed vpaturet closed 4 months ago

vpaturet commented 4 months ago

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.

codecov[bot] commented 4 months ago

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 :warning:
...entripplanner/apis/transmodel/TransmodelGraph.java 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.