Hello,
I need to understand how ContinuationTimeout works and if it is safe to use a Model instance after a timeout exception is thrown.
I wrote down a sample code where I set a very short ContinuationTimeout in order to get TimeoutExceptions from the model operations. My code catches TimeoutExecption and then makes a new BasicGet request.
model.ContinuationTimeout = TimeSpan.FromMilliseconds(50);
do
{
try
{
var basicGetResult = model.BasicGet("ha_TestQ", true);
if (null != basicGetResult)
{
Log("Message received");
}
}
catch (TimeoutException)
{
Log($"*** TIMEOUT ***");
}
catch (NotSupportedException ex)
{
Log($"ERROR: {ex.Message}");
}
Thread.Sleep(5);
} while(true);
Sample output:
Message received
Message received
Message received
Message received
Message received
*** TIMEOUT ***
ERROR: Pipelining of requests forbidden
ERROR: Pipelining of requests forbidden
ERROR: Pipelining of requests forbidden
ERROR: Pipelining of requests forbidden
ERROR: Pipelining of requests forbidden
ERROR: Pipelining of requests forbidden
Message received
Message received
After the TimeoutException the model seems to be busy and the subsequent BasicGet operations get a NotSupportedException with message "Pipelining of requests forbidden".
After a while, BasicGet operations succed and the Model seems to be working well.
My questions are:
1. Is it safe to use the model instance after the first TimeoutException? Or should I close it and instantiate a new one?
2. Is the operation which thrown the exception aborted?
3. When the Model throws NotSupportedException, is it waiting for the previous operation to complete or it requires some time to abort the timed out operation?
Thanks,
Rik