Skip to content

meta(oracle): remove the connection error handler that could never run - #18458

Merged
WikiRik merged 3 commits into
mainfrom
wikirik-agent/oracle-remove-error-handler
Sep 24, 2026
Merged

WikiRik merged 3 commits into
mainfrom
wikirik-agent/oracle-remove-error-handler

Conversation

@wikirik-agent

@wikirik-agent wikirik-agent commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description of Changes

Follow-up to #18218: the last item in this comment.

The Oracle connection manager attached an error handler to every connection, but it could never run:

  • oracledb's Connection is an EventEmitter, but nothing in oracledb 6.10 (lib/, including thin mode's network layer, or the native binding) emits on a connection. The only emitters are Lob/QueryStream streams and Pool's internal events. Thin mode stores socket errors and throws them from the next call.
  • The handler was copied from the MariaDB dialect and checked its error codes (ESOCKET, ECONNRESET, EPIPE, PROTOCOL_CONNECTION_LOST, the same ones MySQL uses), while oracledb errors use NJS-/ORA- codes.

This removes the handler, the placeholder listener that #18218 added in connect(), and the initializeConnection() override, so Oracle falls back to the base class's no-op. Broken connections are still detected by validate() (connection.isHealthy()), as before.

The only thing that ever emitted error on an Oracle connection was the should obtain new connection when old connection is abruptly closed pool integration test, which fakes an ECONNRESET. The handler is what made that test pass for Oracle: without it, the test fails with Error: Test ECONNRESET Error. For Oracle, that test now destroys the connection through the pool instead, like it already does for db2, mariadb and sqlite3.

OracleConnection keeps its on(event: 'error') declaration, so the published type doesn't change (7.0.0-alpha.48 has it). The removeAllListeners declaration is removed: #18218 added it, and it hasn't been released.

Verification

core unit tests with DIALECT=oracle (2494 passing), @sequelize/oracle typings, lint and prettier. core integration tests with DIALECT=oracle against the dev/oracle/latest container: 1775 passing, 0 failing. Without the test change, should obtain new connection when old connection is abruptly closed fails with Error: Test ECONNRESET Error.

List of Breaking Changes

None.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Connection Handling
    • Oracle connections no longer use temporary error listeners or error-event-based pool destruction for socket errors.
  • Tests
    • Abrupt-connection tests now explicitly destroy Oracle connections, as they do for several other database types. Oracle connections do not emit error events.

oracledb connections never emit 'error' (nothing in oracledb 6.10's lib
emits on a Connection), and the handler, copied from the MariaDB dialect,
checked error codes (PROTOCOL_CONNECTION_LOST, ESOCKET, ...) that oracledb
does not use. Remove it along with the placeholder listener and the
initializeConnection override.

The only thing that emitted 'error' on an Oracle connection was the
"abruptly closed" pool integration test, which now destroys the connection
through the pool for Oracle, like it already does for db2, mariadb and
sqlite3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wikirik-agent
wikirik-agent requested a review from a team as a code owner September 24, 2026 09:01
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7b259327-5f80-408d-9187-e1f9afe5907b

📥 Commits

Reviewing files that changed from the base of the PR and between 04e1d2b and db7f3dc.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 288d1aa3-6258-43a8-a93e-c4f042d75cf1

📥 Commits

Reviewing files that changed from the base of the PR and between 9beb2f7 and e4f7ef6.

📒 Files selected for processing (2)
  • packages/core/test/integration/pool.test.ts
  • packages/oracle/src/connection-manager.ts
💤 Files with no reviewable changes (1)
  • packages/oracle/src/connection-manager.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The Oracle connection manager no longer installs temporary or socket-error listeners. The pool integration test now includes Oracle in the direct-connection-destruction path.

Changes

Oracle connection error handling

Layer / File(s) Summary
Oracle connection error handling
packages/oracle/src/connection-manager.ts, packages/core/test/integration/pool.test.ts
The Oracle connection interface and manager no longer declare or install the removed error-listener behavior. The pool integration test includes Oracle in the direct-destruction path.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to e4f7e

No actionable merge-blocking risk remains in the reviewed changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: removing the Oracle connection error handler because it could not run.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WikiRik
WikiRik enabled auto-merge (squash) September 24, 2026 09:19
@WikiRik
WikiRik merged commit 6b155c5 into main Sep 24, 2026
75 checks passed
@WikiRik
WikiRik deleted the wikirik-agent/oracle-remove-error-handler branch September 24, 2026 13:10
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.

2 participants