Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> ! if (portal->status == PORTAL_ACTIVE)
> portal->status = PORTAL_FAILED;
> ! if (portal->status == PORTAL_ACTIVE || portal->status == PORTAL_READY)
> portal->status = PORTAL_FAILED;
I don't think you actually need that change, since you're going to
unconditionally close the portal below. The case for PORTAL_ACTIVE
is just there to dodge the sanity check in PortalDrop.
The routine's comments need a bit of work too. Otherwise it seems OK.
Neil or anyone else --- see an issue here?
regards, tom lane