Hi Andy, James, We've implemented the client timeout on the http requests and will monitor if the issue is still observed, or at least if requests are timing out.
We're using a 120s timeout for all the requests, which should give plenty of time for the query requests to complete in regular circumstances. > -----Original Message----- > From: Andy Seaborne <[email protected]> > Sent: Wednesday, July 7, 2021 1:12 AM > To: [email protected] > Subject: Re: Jena hangs while reading HTTP stream > > > > On 06/07/2021 12:40, John Walker wrote: > > Hi James > > > >> -----Original Message----- > >> From: James Anderson <[email protected]> > >> Sent: Tuesday, July 6, 2021 1:00 PM > >> To: [email protected] > >> Subject: Re: Jena hangs while reading HTTP stream > >> > > >> > >> a stack trace could be very helpful. As no error is thrown, there is no stack trace logged. We'll have to see if the addition of timeout give some handle via which we can grab one. > > > > There is no stack trace captured at the time of the incident and we are > unable to reproduce. > > > > Given this sanitized extract from the application logs directly prior to it > hanging: > > > > c.semaku.es.core.service.UpdateService : Executing : query.rq > > com.semaku.es.core.util.Utils : Send request to: > https://example.com/foo/bar/sparql?query=query.rq > > com.semaku.es.core.util.Utils : Received response in 1397ms for > https://example.com/foo/bar/sparql?query=query.rq > > c.semaku.es.core.service.UpdateService : Loading NTriples to Jena model > > > > The "received response in ..." line is logged after the HttpOp.execHttpGet() > method has been called (which returns the TypedOutputStream). > > > > I am not familiar enough with how these streams work in Jena and Java. > > It is unclear if this indicates Dydra has started to return results after > > 1397ms, > or if the complete response had already been received by the client. > > Started. > > execHttpGet opens the stream; it does not read the body (it reads the > headers). > > The body is the TypedInputStream - there is a normal java InputStream. > > Andy > OK, I've not been able to figure out how the Jena parser reads the stream. As we use N-Triples, I was wondering if the N-Triples parser uses the readLine method to read from the stream. If there were some line that is not terminated with an EOL character, might that cause this issue? Otherwise if the output stream from Dydra is not closed, or the socket is not closed? John
