Timer execution crashes... app?

Hello,
I have setup a timer that connects to an external url to fetch some data, every 60 seconds.
The external host is added in the console and approved.
After the data is received from the external host, I am querying a table to make sure previous instances of the same objects are not inserted again, and then inserting the remaining objects.
Please note that the objects are added as relations of a parent object. But it makes no difference, I was having the same problem when I was individually saving the objects one by one.
The number of objects is never going to be more than 35 for each timer execution.
The actual problem is that, after I deploy the timer for debugging, it runs ok for the first 7-8 iterations, but after that, I get the following error: BackendlessException{ code: ‘Internal client exception’, message: ‘Read timed out’ }
. This occurs when I am trying to query the table above.
Thing is, after this error occurs, I cannot even access the app through the dashboard. Especially Data, Business Logic sections are not working. After around 10 minutes or so, everything is up and running. Until I run the timer again, of course.
I am also measuring the timer execution elapsed time and it is always under 2 seconds.
Attached is the timer code.
What am I doing wrong?

GetLatestSpotsTimer.java.zip (1.89kB)

Hi, Dimitris!

Can you provide your application id here?
Thanks!

Hello Alexandr.

Here it is: 284099AA-17DC-EA4F-FFE8-CD080BAC8E00

Thank you!

I’ve reproduced your issue and opened an internal task for it.
We shall notify you about investigation results.

Should I deploy the timer and have it enabled, would that help?

Thanks.

No, thanks. I’ve reproduced it on my application.

Assigned tag BKNDLSS-12091

Hi, Dimitris!

Can you try to check your timer again?
best regards,
Alex

Hello Alex,

I ran the timer with CodeRunner for two hours and everything seemed to be OK.
I have now deployed it to production. Let’s see how that goes.

Thanks!

Good things don’t last:

Mar 28, 2016 5:07:39 PM com.backendless.coderunner.runtime.task.EventInvocationTask runImpl
SEVERE: Read timed out
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.backendless.coderunner.runtime.task.EventInvocationTask.runImpl(EventInvocationTask.java:92)
at com.backendless.coderunner.runtime.concurrent.ExtendedRunnable.run(ExtendedRunnable.java:26)
at java.lang.Thread.run(Thread.java:745)
Caused by: BackendlessException{ code: ‘Internal client exception’, message: ‘Read timed out’ }
at com.backendless.Invoker$SyncResponder.errorHandler(Invoker.java:127)
at com.backendless.core.responder.AdaptingResponder.errorHandler(AdaptingResponder.java:93)
at weborb.client.ioEngine.HttpIOEngine.send(HttpIOEngine.java:213)
at weborb.client.ioEngine.HttpIOEngine.invoke(HttpIOEngine.java:145)
at weborb.client.WeborbClient.invoke(WeborbClient.java:138)
at com.backendless.Invoker.invokeSync(Invoker.java:100)
at com.backendless.Invoker.invokeSync(Invoker.java:112)
at com.backendless.logging.LogBuffer.reportSingleLogMessage(LogBuffer.java:152)
at com.backendless.logging.LogBuffer.enqueue(LogBuffer.java:109)
at com.backendless.logging.Logger.error(Logger.java:71)
at com.backendless.dxalert.timers.GetLatestSpotsTimer.execute(GetLatestSpotsTimer.java:138)
… 6 more

It looks like it has issues writing to the logger.

Hi Dimitris,

Did the errors continue or was it a one off thing?

Mark

Hello Mark,

It seems that it was intermittent. It was occurring every other timer execution or so.

Now everything seems to be OK, even in production.

Thanks!