pgpool2.git / summary / log / commit / refs

commit    9444f0cc3b131be2faf87e868d249ebf0bc882f5
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sun Sep 03 06:21:34 2017 +0000

    Remove pending message when Close Complete received.
    
    When parse_before_bind() is called and a close message is sent, a
    pending message is created but it is not removed later on. For usual
    close message read_kind_from_backend() does not remove the pending
    message because CloseComplete() does it later on. But in the code path
    for parse_before_bind() gets called, CloseComplete() did not remove
    the pending message. This brings loosing sync of pending messages and
    messages from backend, which could cause a hang in
    read_kind_from_backend().


src/protocol/pool_proto_modules.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index 6ab0c9dc1..1385826ae 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -2602,6 +2602,13 @@ POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend, (errmsg("processing backend response"), errdetail("do not forward close complete message to frontend"))); pool_discard_packet_contents(backend); + + /* Remove pending message here because + * read_kind_from_backend() did not do it. + */ + pmsg = pool_pending_message_pull_out(); + pool_pending_message_free_pending_message(pmsg); + pool_unset_query_in_progress(); pool_set_command_success(); status = POOL_CONTINUE; [parent: 6b4216d429c4]