[Mondrian] Mondrian Query Timeout

Luc Boudreau lucboudreau at gmail.com
Mon Jul 11 11:57:34 EDT 2011


Julian,



Following your commit on the statements refactoring, I have started to think
about how we would now enforce a proper query timeout. (MONDRIAN-415).



What I had in mind is a simple system where, when creating RolapResult
objects (in RolapConnection.execute()) we fork the execution to a second
thread (let’s call it the execution thread). The first thread (let’s call it
the user thread) will wait a predetermined amount of time (the actual
timeout) and if the execution thread has not completed, the user thread will
perform the following.

   - Stop all SQL statements currently associated to this Execution.
   - Do house cleaning.
   - Bake a cake. (optional)
   - Throw back a timeout exception.

This has several advantages. First off, we could remove all checks for query
timeout in the evaluator and centralize everything in a single place.  Second,
as it stands now, there is no way to do a “hard stop” of any SQL statements
running for a given Execution as we sit in the same thread. As long as the
SQL Statement has not returned, we have no way to check for a timeout. As of
now, the best we can do is to set an arbitrary JDBC timeout, but since there
is no telling how many SQL statements will be issued, nor their priority, we
cannot determine the proper JDBC timeout value to apply. By having the user
thread overview the execution process, it becomes much simpler to manage and
cleanup all the resources used by a query execution.


Should I try this approach and submit a first POC?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20110711/9b6d5bc9/attachment.html 


More information about the Mondrian mailing list