Repository navigation
Fix: federation requests timeout - #24
Merged
Merged
Conversation
syphax-bouazzouni
suggested changes
Jan 9, 2025
|
The demo video was nice |
|
Quick question: can you leave the time out at 60s and do only one call if the first one fails. I mean, you go to the 2 other calls only of the first one doe snot times out. |
Author
|
we decided today to keep the timeout 30s |
Author
|
@syphax-bouazzouni Tests working now, ready to be merged |
Bilelkihal
commented
Jan 29, 2025
syphax-bouazzouni
suggested changes
Jan 29, 2025
syphax-bouazzouni
suggested changes
Jan 30, 2025
| gem 'test-unit' | ||
| gem 'webmock', require: false No newline at end of file | ||
| gem 'webmock', require: false | ||
| gem 'activesupport', '~> 7.0.8' No newline at end of file |
There was a problem hiding this comment.
no need to add this as it is already added in the gemspec file
| module Client | ||
| module RequestFederation | ||
|
|
||
| CACHE = ActiveSupport::Cache::MemoryStore.new |
There was a problem hiding this comment.
this will not work as expected as in the Rails we don't use MemoryStore, but MemeCache or Redis.
…eping tests running
Author
|
@syphax-bouazzouni Finally I initialized a fake Rails.cache in the tests envirenment that uses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: agroportal/ontoportal_web_ui#889
Problem Description
The current implementation of the get method has a timeout set to 60 seconds. This creates a significant delay in cases where a portal (e.g., BiodivPortal) is down because multiple requests are sent for a single operation. For example:
1 - If BiodivPortal is down, selecting it on the browse page triggers multiple requests to its API endpoints (e.g.,
/ontologies,/submissions,/categories, etc.).2 - Each request waits for the full 60-second timeout before failing.
3 - This results in compounded delays, causing the user to wait for several minutes before receiving feedback.
Proposed solution in this PR
To address this issue, this PR introduces the following improvements:
Result
Demo
Fully explained in browse page (enable sound)
https://drive.google.com/file/d/13JAVRZradprsXNjwmhJj_AMA58WwTTYr/view?usp=sharing
Screenshot from search page
