Hello Mitchell,
I failed to reproduce the behavior you described, in my case the timer continues to execute even though I receive the same error. Here’s what I’ve done to verify your issue:
- Create a Java Timer which runs every 60s
- Create a table (e.g.
Order
in my app) with one object (let’s say it’s ID is CFE4F1F9-2114-A118-FF45-2C00E2E5FE00
)
- Add this code to the Timer:
final Map order = Backendless.Data.of( "Order" ).findById( "CFE4F1F9-2114-A118-FF45-2C00E2E5FE00" );
Backendless.Logging.getLogger( "Sample" ).info( order.toString() );
Backendless.Data.of( "Order" ).findById( "XXX" );
- Compile the code and deploy the timer
- Watch time execution (I used real-time logging console for that)
And here’s the result I get:
Thu Feb 07 2019 16:30:53 GMT+0200 (Eastern European Standard Time) | Sample | INFO | {created=Thu Feb 07 14:29:41 UTC 2019, ___class=Order, ownerId=null, updated=null, objectId=CFE4F1F9-2114-A118-FF45-2C00E2E5FE00}
Thu Feb 07 2019 16:30:53 GMT+0200 (Eastern European Standard Time) | Coderunner | ERROR | Business logic execution has been stopped, due to error: Code: 1000 Class: com.backendless.exceptions.BackendlessException Message: Entity with ID XXX not found
Thu Feb 07 2019 16:31:53 GMT+0200 (Eastern European Standard Time) | Sample | INFO | {created=Thu Feb 07 14:29:41 UTC 2019, ___class=Order, ownerId=null, updated=null, objectId=CFE4F1F9-2114-A118-FF45-2C00E2E5FE00}
Thu Feb 07 2019 16:31:53 GMT+0200 (Eastern European Standard Time) | Coderunner | ERROR | Business logic execution has been stopped, due to error: Code: 1000 Class: com.backendless.exceptions.BackendlessException Message: Entity with ID XXX not found
Thu Feb 07 2019 16:32:53 GMT+0200 (Eastern European Standard Time) | Sample | INFO | {created=Thu Feb 07 14:29:41 UTC 2019, ___class=Order, ownerId=null, updated=null, objectId=CFE4F1F9-2114-A118-FF45-2C00E2E5FE00}
Thu Feb 07 2019 16:32:53 GMT+0200 (Eastern European Standard Time) | Coderunner | ERROR | Business logic execution has been stopped, due to error: Code: 1000 Class: com.backendless.exceptions.BackendlessException Message: Entity with ID XXX not found
...
As you see, the timer does throw an error, but it still executes every minute. So I have to ask you to provide us any more detailed steps which are needed to see your issue, in case you are able to reproduce it persistently.
For now it seems to me that the stopped timer in your case has nothing to do with the errors or timeouts in the code.
First, the timeout cannot happen in case an unhandled exception is thrown. Because in this case the CodeRunner immediately stops executing your code and there’s just no time spent after the exception happens, therefore if you see such error - your timer has already finished its work. Most probably you received the timeout notifications in relation to other runs of the timer.
Second, the code scheduling the Timer tasks is a totally different process from the code executing your code (i.e. from the CodeRunner on Backendless side). So it’s not likely that any behavior in CodeRunner can cause troubles in the timer tasks scheduler.
Truth be told, we do receive occasional reports from our customers about stopped timers execution. And unfortunately, there’s no way we could guarantee you that the scheduling never stops (so as there’s no way any other software can strongly guarantee you this). Being aware of such a possibility, we do our best in trying to detect and prevent such failures, e.g. we have a special app with a timer for monitoring purposes, and when the outer system detects that the timer is not active, we forcefully reschedule all the timers. And still, as you see, we miss the problems sometimes.
Therefore, we’d be really grateful if you were able to provide us enough information in order to investigate at least your specific case.