Repository navigation
fix: decode a server warning, and keep the one a login raises - #15
Merged
Merged
Conversation
Swift 6.4 resolves `OracleBackendMessage.`Protocol`.decode` in an expression to the metatype and refuses it, so the test target did not compile. A type annotation names the nested type instead.
A warning message carries its number, length and flags as UB2 and its text with its own length prefix. They were read as fixed 2-byte integers and a raw string of that length, so the read ran past the packet and the decoder waited for bytes the server never sends. A password in its grace period (ORA-28002, ORA-28098 on 23ai) sends two such warnings ahead of the authentication reply, so the login hung until its deadline. The warning a login raises is now kept by the authentication state machine and exposed as OracleConnection.loginWarning, since the login still succeeds.
This is a follow up on lovetodream#114, since that was too specific to the auth/connection process. And required setup work outside of the test. This implementation does all the setup inside tests and handles warnings the same way as errors. Closes lovetodream#113 --------- Signed-off-by: Timo <38291523+lovetodream@users.noreply.github.com> (cherry picked from commit 08bcddc)
A warning message with no number or text reports nothing, so it no longer replaces the warning an earlier message in the same login carried.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A login whose password is in its grace period hung until the login deadline. Oracle answers it with ORA-28002 (ORA-28098 on 26ai), sent as a warning message, twice, ahead of the authentication reply. Measured on Oracle 23.26 Free, reported on 19c (TableProApp/TablePro#3401).
decodeWarningread fixed 2-byte integers and a raw string of that length, so the read ran past the packet and the decoder waited for bytes the server never sends. Upstream fixed this in Fix decoding error when receiving a warning packet lovetodream/oracle-nio#121 (closes Connect hangs at auth phase two for accounts in EXPIRED(GRACE) — decodeWarning uses raw UInt16 instead of UB2 lovetodream/oracle-nio#113), whichtablepro-maindid not have; it is cherry-picked here with its integration test, keeping this branch'sBackendErrorhardening. The new unit test fixture is the warning captured off the wire..authenticated.OracleConnection.loginWarning(a newOracleWarningwith the number and the server's text) exposes it, because the login still succeeds and the user needs to read it. A warning that arrives with a statement is logged as before.ProtocolMessageTestsdid not compile on Swift 6.4, which readsOracleBackendMessage.Protocol.decodeas the metatype.Tests: the new unit tests fail on the old decoder and pass here. 505 unit tests and 93 integration tests against 23.26, including upstream's
warning(), give the same result astablepro-main:oobCheckWorkshangs, twoOracleNetworkSecurityTestsandcustomTypefail on both.TableProApp/TablePro#3407 pins the head of this branch, so merge it with a merge commit.