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 external validator timeout #670

Merged
merged 2 commits into from
Jan 20, 2025
Merged

Conversation

jsharkey13
Copy link
Member

Without a timeout specified here, the .send() call would block indefinitely. I believe 1 second is a safe enough limit; most validator requests take around 50-100ms (and trivial requests much less).
However, we should keep an eye on this when deployed.

This should prevent the validator from queuing too many requests and exhausting the Jetty threadpool.

For symbolic questions, the most common, explicitly log the timeout as an error by itself, to aid review of the timeout duration.

Without a timeout specified here, the .send() call would block
indefinitely. I believe 1 second is a safe enough limit; most validator
requests take around 50-100ms (and trivial requests much less).
However, we should keep an eye on this when deployed.

This should prevent the validator from queuing too many requests and
exhausting the Jetty threadpool.
For symbolic questions, the most common, explicitly log the timeout as
an error by itself, to aid review of the timeout duration.
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

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

Project coverage is 34.37%. Comparing base (0547db1) to head (1a82858).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
.../cam/cl/dtg/isaac/quiz/IsaacSymbolicValidator.java 0.00% 4 Missing ⚠️
...n/java/uk/ac/cam/cl/dtg/isaac/quiz/IValidator.java 0.00% 1 Missing ⚠️
...tg/isaac/quiz/IsaacSymbolicChemistryValidator.java 0.00% 1 Missing ⚠️
...cl/dtg/isaac/quiz/IsaacSymbolicLogicValidator.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #670      +/-   ##
==========================================
- Coverage   34.37%   34.37%   -0.01%     
==========================================
  Files         521      521              
  Lines       23474    23477       +3     
  Branches     2875     2876       +1     
==========================================
  Hits         8070     8070              
- Misses      14592    14595       +3     
  Partials      812      812              

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

@sjd210
Copy link
Contributor

sjd210 commented Jan 20, 2025

Tested this with adding sleep() to the symbolic validator locally and it works 👍

1 second seems like a reasonable cutoff point. This should stop the Jetty threads being the bottleneck, so I'll be curious to see how the validators themselves handle an influx of requests if/when we get that again.

@sjd210 sjd210 merged commit 478b239 into master Jan 20, 2025
3 checks passed
@sjd210 sjd210 deleted the feature/external-validator-timeout branch January 20, 2025 11:34
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