-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support external configuration of HTTP-related timeouts when invoking microservice endpoints. #79
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #79 +/- ##
============================================
+ Coverage 90.00% 90.68% +0.68%
- Complexity 73 82 +9
============================================
Files 10 11 +1
Lines 300 322 +22
Branches 1 1
============================================
+ Hits 270 292 +22
Misses 29 29
Partials 1 1
Continue to review full report at Codecov.
|
Thank you for this, @emetsger ! Alas, I'm afraid we have one small hoop to clear for it to be mergeable: Before you set out to contribute code you will need to have completed a Contributor License Agreement or be covered by a Corporate Contributor License Agreement. The signed copy of the license agreement should be sent to mailto:community@islandora.ca This license is for your protection as a contributor as well as the protection of the Foundation and its users; it does not change your rights to use your own contributions for any other purpose. |
Hi @manez, I sent a CLA to community@ on June 17, so it should be waiting for you! Let me know if you don't see it and I can re-send.
|
@emetsger we have it, sorry for the confusion. |
Sry that slipped through the cracks. I'll try testing now 🚀 This came up during our testing sprint so we'd like to get this in sooner rather than later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work for me. I'm having a hard time recreating the timeout fails, but I can confirm that deploying new artifacts with these changes work, they do not affect existing routes, and that routes that wish to use them can configuring the http and https beans appropriately.
Big 👍 for the test, too. Let's do this 🚀
We'll have to update the blueprints that both the playbook and ISLE deploy to take advantage of the timeouts. |
What does this Pull Request do?
At Johns Hopkins we've found that derivative generation, especially for TIFFs and video files exceeding 500MiB, can exceed the default timeouts of various components in the Islandora stack including: Nginx, PHP-FPM, and Apache HttpClient. Configuring the timeouts of Nginx and PHP-FPM are relatively easy, but unfortunately Alpaca is slightly more challenging.
There are two options that were explored:
HttpClientConfigurer
to configure timeoutsThe former option would be considered a breaking change: the Alpaca upgrade would not be a drop-in replacement; adopters would need to update their blueprint configurations to supply default values. (AFAICT, the simple EL doesn't provide a way in-line default values).
The latter approach is drop-in. If adopters do not update their blueprint configuration, then the custom
HttpClientConfigurer
is simply unused. (Note thatDerivativeConnectorTest
passes without any modifications to it or the blueprint).What's new?
This PR introduces a custom
HttpClientConfigurer
(RequestConfigConfigurer
) which is used by Camel to create a default instances ofRequestConfig
, which carries the timeout values described above.For the Islandora stack, this means updating the Karaf artifacts by amending
blueprint.xml
to add reasonable default values, and optionally supporting custom values using Karafcfg
files. For example, ISLE users will need to apply something like the following:How should this be tested?
Run tests and see that they pass. A full end-to-end test (e.g. ingesting a large video file into Islandora and witnessing a service derivative being generated by homarus) may be possible depending on available resources and the alignment of HTTP-related timeouts throughout the stack.
Interested parties
@Islandora/8-x-committers