Skip to content

Commit 7cc98a1

Browse files
committed
Add clarification comment for spock_disable_subscription
It may be unclear to detect if someone forget to commit after the call of this function wiping out the result. So, add a comment to reduce number of coding errors.
1 parent d6aa73d commit 7cc98a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/spock_exception_handler.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ add_entry_to_exception_log(Oid remote_origin, TimestampTz remote_commit_ts,
217217
* This function is invoked when the configured exception handling behavior is
218218
* SUB_DISABLE, meaning the subscription must be suspended instead of skipping
219219
* or retrying the failing transaction.
220+
*
221+
* May be called with or without an active transaction. If no transaction is
222+
* in progress, one is started and committed internally. If the caller already
223+
* holds an open transaction, it is the caller's responsibility to ensure that
224+
* transaction is either committed or terminates with a FATAL error; otherwise
225+
* the subscription state change and exception_log entry will be rolled back.
220226
*/
221227
void
222228
spock_disable_subscription(SpockSubscription *sub,

0 commit comments

Comments
 (0)