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
org.synbiohub.frontend.SynBioHubFrontend should include timeouts #559
Comments
Additional diagnostic information. A read that normally completes in a couple of minutes hung for multiple hours. Stack inspection found the following trace, identifying the issue:
|
Discussing this with @zachzundel, he thinks we should implement the solution on the SynBioHub side. Namely, that the HTTP requests should initiate the request, and return as quickly as possible. SBH should cache the result of the fetch and the frontend would be able to repeat the request eventually getting the document back once the fetch has concluded. This will require changes on both SBH and libSBOLj, but it seems this will be less overhead and be more robust in the long run. @zachzundel please add your thoughts and also open the SBH issue for this too. |
Let me run two scenarios past you:
I don't see any way for SynBioHub to distinguish between these two clients. Thus, I think that it's going to be important to let the client also be able to set their own abort. And if libSBOLj doesn't do it, then we're probably just going to write a library function around the library that will abort the library instead. |
I think what we are suggesting will address your concerns. The idea is that SBH would not be blocking. Namely, you send a request then it would respond that it got your request. You could probe the same URL to see when the request has been completed. The library then could have a blocking method that essentially busy waits polling for the request to be processed, as well as another method which takes a time limit and polls until the time limit has been exceeded. |
That doesn't address the case of a very slow download. |
I think we can still add a timeout to the SynBioHubFrontend, but SynBioHub itself will be more asynchronous, like Chris described. |
Very slow download is usually due to the time it takes to create the SBOL file. Certainly, if we get SBOL files in the GBs, then we may see it to be a transfer problem, but right now it is usually not the bottleneck. Even so, I think a timeout that I propose will allow you to say how long you are willing to wait for the download, and this may be file construction and/or download time. |
I’ve added a new constructor for SynBioHubFrontend which takes a timeout in seconds:
public SynBioHubFrontend(String backendUrl,int timeout)
Please test.
… On Aug 14, 2018, at 6:30 PM, Jacob Beal ***@***.***> wrote:
Unless specifically disabled, org.synbiohub.frontend.SynBioHubFrontend should include an HTTP timeout in the configuration of the HTTP connection.
Currently when fetching items from SynBioHub, the SynBioHubFrontend class performs a blocking read inside of org.synbiohub.frontend.SynBioHubFrontend.fetchContentAsInputStream. Normally, this is not a problem, but when a read dies in the middle (as can happen with very large pulls on occasion), this leaves the thread hung with no exception.
This issue is currently causing freezes in the SD2 Dictionary Maintainer. It can be kludged around by implementing a timeout on SynBioHubFrontend, but should properly be addressed within the library by setting the timeout on the HTTP operation instead.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#559>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADWD96IffoWL0MkLm3IsPkb8W36vQgy7ks5uQ2uYgaJpZM4V9YGx>.
|
@bbartley Can you please test this with the SD2 dictionary? |
@dsumorok-raytheon has incorporated use of this in the SD2 dictionary, so I think it can be counted as tested and resolved. |
Unless specifically disabled, org.synbiohub.frontend.SynBioHubFrontend should include an HTTP timeout in the configuration of the HTTP connection.
Currently when fetching items from SynBioHub, the SynBioHubFrontend class performs a blocking read inside of org.synbiohub.frontend.SynBioHubFrontend.fetchContentAsInputStream. Normally, this is not a problem, but when a read dies in the middle (as can happen with very large pulls on occasion), this leaves the thread hung with no exception.
This issue is currently causing freezes in the SD2 Dictionary Maintainer. It can be kludged around by implementing a timeout on SynBioHubFrontend, but should properly be addressed within the library by setting the timeout on the HTTP operation instead.
The text was updated successfully, but these errors were encountered: