Stmt timeout error can be sent after a CommandComplete - Mailing list pgsql-hackers

From Anthonin Bonnefoy
Subject Stmt timeout error can be sent after a CommandComplete
Date
Msg-id CAO6_Xqqq2UAeRxrjxN9htu4RtvxJEWw4rLha4mPe5FOoZ2Byug@mail.gmail.com
Whole thread Raw
Responses Re: Stmt timeout error can be sent after a CommandComplete
List pgsql-hackers
Hi,

At the end of a command, disable_statement_timeout is called as the
timeout applies to a specific command and a CommandComplete message is
sent.

However, it's possible for the stmt timeout to have been fired between
the last message and the call to disable_statement_timeout. The
timeout won't be active anymore, so disable_timeout will be skipped.
However, the timeout is still queued, and the next call to
CHECK_FOR_INTERRUPTS will process and generate a stmt timeout error.

This leads to the confusing situation where we can have a
CompleteCommand message followed by a stmt timeout error for the same
command.

This patch fixes this issue by resetting the timeout indicator if the
timeout is inactive, relying on get_timeout_indicator to reset the
timeout indicator.

Regards,
Anthonin Bonnefoy

Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Next
From: "liujinyang"
Date:
Subject: remove the unneeded header file math.h in binaryheap.c