At Thu, 2 Feb 2017 08:46:11 +0900, Michael Paquier <michael.paquier@gmail.com> wrote in
<CAB7nPqR6VQ7aiKck1Ao3_mPVvn4v4ZKnJFq2oawFqpaePHd18A@mail.gmail.com>
> On Thu, Feb 2, 2017 at 2:14 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
> > The lwlock would be released when an exception occurs, so I don't think
> > that TRY-CATCH is necessary here. Or it's necessary for another reason?
>
> + PG_CATCH();
> + {
> + LWLockRelease(LogicalRepLauncherLock);
> + PG_RE_THROW();
> + }
> + PG_END_TRY();
> Just to do that, a TRY/CATCH block looks like an overkill to me. Why
> not just call LWLockRelease in the ERROR and return code paths?
I though the same first. The modification at the "if (wrconn =="
is the remains of that. It is reverted inthe attached patch.
Then, the reason for the TRY-CATCH cluase is that I found that
some functions called from there can throw exceptions.
logicalrep_worker_stop and replorigin_drop have ereport in its path.
load_library apparently can throw exception.
(walrcv_(libpq_) functions don't seeem to.)
regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center