[TAP] sync vs async - time outs

Tom McGlynn Thomas.A.McGlynn at nasa.gov
Wed Mar 4 07:48:19 PST 2009


Hi Gerard,

I agree with what you had said more elegantly in your earlier message. 
My point was to emphasize my sense that that people were saying 
asynchronous calls somehow obviated the need for careful timeout 
handling.  E.g., Guy suggested that we have to allow asynchronous calls 
if we can't handle queries synchronously.  But this is really just a 
statement about the length of queries we are going to support.  Do we 
mandate that we have to support queries that take 24 hours?  100?  1000? 
  10000?  Our services will all presumably implement some cutoff.  Are 
we mandating some minimum value for that cutoff?  My sense is that we 
don't typically mandate such limits on our services, but we may want to 
manifest whatever limits there are in the metadata.

I suspect that not having support for timeout queries is a pretty 
common issue in the various APIs to the various databases.  However I 
think one can generally get around that by setting a timer in another 
thread/process, terminating the query when that timer goes off, and 
reporting a clean error to the user.  I'd think that would be especially 
easy in Java.  Might leave some ghost query running, but that's not the 
client's problem!

	Regards,
	Tom


Gerard wrote:
>  
> Hi Tom
>> One thing that confuses me a little about this discussion, 
>> seems to be the implicit assumption that we don't need to 
>> worry about timeouts for asynchronous queries.  
> async was included in the discussion 
> (http://www.ivoa.net/forum/dal/0903/1028.htm)
>> For synchronous services it's a little harder since we need 
>> to make sure that we send an appropriate message before the 
>> connection dies.  
> 
> Indeed, one of the questions I get now and then is what the meaning is of
> the message: 
> 
> Bad Gateway!
> The proxy server received an invalid response from an upstream server. 
> ...
> 
> 
>> Maybe allow a timeout value for synchronous 
>> services? [Does it already exist?]
>>   While I'm not sure that the underlying databases support 
>> timeouts, it's easy enough to put the timeout in the layer 
>> that calls the database.  
> Postgres' JDBC driver for a long time (still?) did not support the
> setQueryTimeout.
> 
> 
> Gerard
> 
> 



More information about the dal mailing list