Skip to content

fix(v2,v3): answer every reset marker after a break so a cancelled call returns - #794

Open
sabinjose wants to merge 1 commit into
sijms:masterfrom
sabinjose:fix/break-reset-marker
Open

sabinjose wants to merge 1 commit into
sijms:masterfrom
sabinjose:fix/break-reset-marker

Conversation

@sabinjose

Copy link
Copy Markdown

Fixes #793

Problem

When the context of an ExecContext with array binds ends while the statement waits on a row lock, the call never returns on Oracle 19c and 23ai. After the client's break and reset, the server sends a second reset marker and holds the call's response until that reset is answered too. processMarker sent one reset and read one packet, so the client and the server waited on each other. The trace is in #793.

Fix

  • After a break sent by the client (IsBreak()), processMarker answers each reset marker with a reset until a data packet arrives, at most 8 times.
  • A marker exchange the server starts on its own (for an error) is handled as before.
  • The reset steps (marker, then the data integrity and encryption reset) move into sendReset, so every reset does the same thing.

Tests

TestCancelArrayDMLWaitingOnRowLock in v2/module_test and v3/module_test (needs ORACLE_DSN, skipped without it): one session holds a row lock, a second runs a MERGE with array binds under a 3 s context timeout, and the test fails if the call has not returned 60 s later.

Oracle master this PR
11.2.0.1 passes (returns after 9 s) passes (returns after 9 s)
19.18 fails: never returns passes: returns after 6 s
23.26.1 fails: never returns passes: returns after 4 s

Same results for v2 and v3. With this PR the call returns ORA-01013 in v2 and context deadline exceeded in v3, as it already does with scalar binds.

Also checked on 19.18 and 23.26.1, with the same results as on master: a server error (ORA-00942, ORA-20001) followed by another statement on the same connection, a deadlock (ORA-00060) with array binds, and a cancelled scalar UPDATE followed by reuse of the pool. The existing tests in module_test and network give the same results as on master (TestDataType_Int, TestDataType_Money, TestDataType_Real and TestDataType_RealNonFraction fail on both).

…ll returns (sijms#793)

When the context of an ExecContext with array binds ended while the
statement waited on a row lock, the call never returned on Oracle 19c
and 23ai. After the client's break and reset, the server sends a second
reset marker and holds the call's response until that reset is answered
too. processMarker read one packet and returned, so the client and the
server waited on each other.

After a break sent by the client, processMarker now answers each reset
marker with a reset until a data packet arrives (at most 8). A marker
exchange the server starts on its own, for an error, is handled as
before.

Added TestCancelArrayDMLWaitingOnRowLock to v2/module_test and
v3/module_test.

Fixes sijms#793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExecContext with array binds never returns when its context ends during a row lock wait (19c, 23ai)

1 participant