Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

async.c

Blame
    • Tom Lane's avatar
      cd89965a
      Fix bogus when-to-deregister-from-listener-array logic. · cd89965a
      Tom Lane authored
      Since a backend adds itself to the global listener array during
      Exec_ListenPreCommit, it's inappropriate for it to remove itself during
      Exec_UnlistenCommit or Exec_UnlistenAllCommit --- that leads to failure
      when committing a transaction that did UNLISTEN then LISTEN, since we end
      up not registered though we should be.  (This leads to missing later
      notifications, or to Assert failures in assert-enabled builds.)  Instead
      deal with deregistering at the bottom of AtCommit_Notify, when we know the
      final state of the listenChannels list.
      
      Also, simplify the representation of registration status by replacing the
      transient backendHasExecutedInitialListen flag with an amRegisteredListener
      flag.
      
      Per report from Greg Sabino Mullane.  Back-patch to 9.0, where the problem
      was introduced during the LISTEN/NOTIFY rewrite.
      cd89965a
      History
      Fix bogus when-to-deregister-from-listener-array logic.
      Tom Lane authored
      Since a backend adds itself to the global listener array during
      Exec_ListenPreCommit, it's inappropriate for it to remove itself during
      Exec_UnlistenCommit or Exec_UnlistenAllCommit --- that leads to failure
      when committing a transaction that did UNLISTEN then LISTEN, since we end
      up not registered though we should be.  (This leads to missing later
      notifications, or to Assert failures in assert-enabled builds.)  Instead
      deal with deregistering at the bottom of AtCommit_Notify, when we know the
      final state of the listenChannels list.
      
      Also, simplify the representation of registration status by replacing the
      transient backendHasExecutedInitialListen flag with an amRegisteredListener
      flag.
      
      Per report from Greg Sabino Mullane.  Back-patch to 9.0, where the problem
      was introduced during the LISTEN/NOTIFY rewrite.