Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

We have an installation using an ODATA server on SQL Anywhere Network Server Version

The installation work fine up to a certain request rate, after which the response time deteriorates rapidly. We are now trying to find the bottleneck.

The only things we found which explicitly states an error are the diagnostics files which are created when we are near or over the critical request rate. They are all more or less identically like the example cited below.

It sounds like some java job is complaining that its partner has closed the connection. Is there any way to find out who is complaining, is it the database server itself, the ODATA producer or something else? And, maybe, some hint about the partner who closed the channel.

Content of the diagnostics file:
at com.sybase.odata.producer.odata.MetadataDocWriter.writeMetadataDoc(
at com.sybase.odata.producer.handler.GetHandler.handleRequestImpl(
at com.sybase.odata.producer.handler.AbstractHandler.handleRequest(
at com.sybase.odata.producer.servlets.ODataServlet.doGet(
at javax.servlet.http.HttpServlet.service(
at com.sybase.odata.producer.servlets.ODataServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(
at org.eclipse.jetty.server.HttpChannel.dispatch(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
Caused by:
at org.eclipse.jetty.server.HttpConnection$SendCallback.process(
at org.eclipse.jetty.util.IteratingCallback.processing(
at org.eclipse.jetty.util.IteratingCallback.iterate(
at org.eclipse.jetty.server.HttpConnection.send(
at org.eclipse.jetty.server.HttpChannel.sendResponse(
at org.eclipse.jetty.server.HttpChannel.write(
at org.eclipse.jetty.server.HttpOutput.channelWrite(
at org.eclipse.jetty.server.HttpOutput.channelWrite(
at org.eclipse.jetty.server.HttpOutput.flush(
... 35 more
Caused by: An existing connection was forcibly closed by the remote host
at Method)
at java.nio.channels.SocketChannel.write(
... 50 more

asked 27 Oct '22, 07:53

tedfroehlich's gravatar image

accept rate: 20%

edited 27 Oct '22, 08:01

Volker%20Barth's gravatar image

Volker Barth

I don't have a clue but as a general question: Do you run OData with a log file ("dbsrvsrv17 -xs odata(LOG=...)") and if so, does this reveal any hints?

(27 Oct '22, 08:00) Volker Barth
Replies hidden

Yes, we are running OData with LogVerbosity=3, and it indeed reports an error:

R. 2022-10-27 08:49:52. [odata_register:207] Request GET$metadata

E. 2022-10-27 08:49:52. [odata_register:207] (HTTP 500 Internal Server Error - 30000) An unexpected error occurred in the producer and was written to file "C:\ProgramData\SQL Anywhere 17\diagnostics\ODP17_20221027_084952_751.txt"

The requests preceding the error vary. A cursory look gives the request for metadata, GET calls to different procedures, POST calls to different database views

(27 Oct '22, 08:21) tedfroehlich

I know, that I must be late. Here is what I see: 1. the end-user tries to get $metadata; 2. OData producer prepares it (builds XML tags as a collection of strings), and starts flushing it to the connection (between the user and the server, or client and OData server). Technically, it is a socket and we throw our bytes into it. 3. At some point of time, when this happens, the connection is terminated.

Internet says, this errors happens when SOMEBODY closes the connection. I doubt that something goes wrong with the server, because the error says that "remote host forcibly closed the connection". So it means that the user all of a sudden decided to give up, and terminated the connection, or somebody did it for him.

Now, we come to the point who is guilty? Again, Internet says, the connection is closed, when the "RST" (reset) packet comes from any party (in our case, again, I assume this is a client). And people suggest to run Wireshark on the server side and check all incoming packets to this port. If you see the RST packet coming from the client, you probably has to start Wireshark on the client side and assure that it was sent by HIM, not by his firewall, router or a proxy server.

People tell, that sometimes (if the connection is long enough) the browser/client can terminate it after some timeout (e.g. at SAP Cloud etc, the timeout is usually 30 seconds, so if your connection is active for this time, it should be m-m-m-m killed). This you can confirm only if you detect/capture RST packet.

Now we come to the question, what if our response time was so long, that the end-user gave up. In theory (I have never done this before) since OData server is just a stupid Java servlet. Thank God, it is running on SAP JVM, so it is better to switch to SAP JDK (8 of course), and profile it as a regular Java application.

Unfortunately, Java profiling goes beyond this comment, but if you don't have an answer on this topic, feel free to try my idea. As I said, I don't know what happened, but I wish I can come to you and check it myself :) I like these riddles.

(28 Oct '22, 15:43) Vlad
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 Oct '22, 07:53

question was seen: 527 times

last updated: 28 Oct '22, 15:43