On 28 October 2014 09:18, Amit Kapila Wrote,

>I am worried about the case if after setting the inAbort flag,
>PQCancel() fails (returns error).
>
>> If select(maxFd + 1, workerset, NULL, NULL, &tv); come out, we can know 
>> whether it came out because of cancel query and handle it accordingly.
>>
>
>Yeah, it is fine for the case when PQCancel() is successful, what
>if it fails?
>I think even if select comes out due to any other reason, it will behave
>as if it came out due to Cancel, even though actually Cancel is failed,
>how are planning to handle that case?

I think If PQcancel fails then also there is no problem, because we are setting 
inAbort flag in handle_sigint handler, it means user have tried to terminate.

So in this case as well we will find that inAbort is set so we return error, 
and in error case we finally call DisconnectDatabase, and in this function we 
will send the PQcancel for all active connection and then only we disconnect.

Regards,
DIlip

Reply via email to