On Tue, Oct 7, 2014 at 11:10 AM, Dilip kumar <dilip.ku...@huawei.com> wrote:
>
> On 26 September 2014 12:24, Amit Kapila Wrote,
>
> >I don't think this can handle cancel requests properly because
>
> >you are just setting it in GetIdleSlot() what if the cancel
>
> >request came during GetQueryResult() after sending sql for
>
> >all connections (probably thats the reason why Jeff is not able
>
> >to cancel the vacuumdb when using parallel option).
>
>
>
> You are right, I have fixed, it in latest patch, please check latest
patch @ (
4205e661176a124faf891e0a6ba9135266363...@szxeml509-mbs.china.huawei.com)
>


***************
*** 358,363 **** handle_sigint(SIGNAL_ARGS)
--- 358,364 ----

  /* Send QueryCancel if we are processing a database query */
  if (cancelConn != NULL)
  {
+ inAbort = true;
  if (PQcancel(cancelConn, errbuf, sizeof(errbuf)))
  fprintf(stderr, _("Cancel request sent\n"));
  else

Do we need to set inAbort flag incase PQcancel is successful?
Basically if PQCancel fails due to any reason, I think behaviour
can be undefined as the executing thread can assume that cancel is
done.

*** 391,396 **** consoleHandler(DWORD dwCtrlType)
--- 392,399 ----
  EnterCriticalSection
(&cancelConnLock);
  if (cancelConn != NULL)
  {
+ inAbort =
true;
+

You have set this flag in case of windows handler, however the same
is never used incase of windows, are you expecting any use of this
flag for windows?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Reply via email to