Skip to content

Fixes 32081: initialize DB2 CLI driver once per process - #32083

Merged
IceS2 merged 2 commits into
mainfrom
rca-db2-reinit-issue
Aug 26, 2026
Merged

IceS2 merged 2 commits into
mainfrom
rca-db2-reinit-issue

Conversation

@IceS2

@IceS2 IceS2 commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #32081

Cache the successfully installed DB2 CLI driver version for the ingestion process. Repeated DB2 sampling connections now reuse that installation, concurrent callers serialize installation, failed installs remain retryable, and requesting a different version still reinstalls it.

Module invalidation now happens at the successful installation boundary instead of on every DB2 connection.

Type of change:

  • Bug fix

High-level design:

N/A — targeted DB2 connector fix.

Tests:

Use cases covered

  • Repeated connections requesting the same CLI driver version install it once per process.
  • A failed installation is retried on the next request.
  • A different requested version triggers a new installation.
  • Concurrent callers requesting the same version serialize installation.

Unit tests

  • Added focused DB2 CLI driver regression tests in ingestion/tests/unit/source/database/db2/test_clidriver.py.
  • PYTHONPATH=src ../env/bin/pytest -q tests/unit/source/database/db2 — 22 passed, 5 skipped.

Backend integration tests

  • Not applicable; no backend API changes.

Ingestion integration tests

  • Validated containerized DB2 metadata, profiler, and auto-classification workflows against multiple tables; the driver-install boundary ran once per workflow process.

Playwright (UI) tests

  • Not applicable; no UI changes.

Manual testing performed

  1. Built the patched ingestion image for linux/amd64 with the DB2 dependency.
  2. Started a local OpenMetadata stack and DB2 12.1.5 container.
  3. Verified the patched ingestion container connected to DB2 and discovered the seeded tables.
  4. Ran metadata, profiler, and auto-classification workflows and verified repeated table sampling did not repeat driver installation within a workflow process.

UI screen recording / screenshots:

Not applicable; no UI changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • No explanatory code comments are needed beyond the existing runtime-install boundary note.
  • No JSON Schema changes are included.
  • No UI changes are included.
  • I added tests covering the exact regression scenario.

Greptile Summary

The PR makes DB2 CLI-driver initialization process-scoped while preserving retries after failed installations.

  • Serializes installation with a module-level lock.
  • Reuses successful installations for matching driver versions and reinstalls when the requested version changes.
  • Moves clidriver module invalidation to the successful installation boundary.
  • Adds regression coverage for reuse, retries, version changes, and concurrent callers.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/database/db2/utils.py Adds synchronized, version-aware process-local installation state and invalidates the runtime module after successful installation.
ingestion/src/metadata/ingestion/source/database/db2/connection.py Removes per-connection module invalidation and reload now that installation owns that lifecycle boundary.
ingestion/tests/unit/source/database/db2/test_clidriver.py Covers same-version reuse, retry after failure, version changes, and concurrent installation serialization.

Reviews (2): Last reviewed commit: "Merge branch 'main' into rca-db2-reinit-..." | Re-trigger Greptile

@IceS2
IceS2 requested a review from a team as a code owner August 26, 2026 08:07
Copilot AI lite review requested due to automatic review settings August 26, 2026 08:07
@IceS2 IceS2 added Ingestion safe to test Add this label to run secure Github workflows on PRs db2 labels Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Caches the DB2 CLI driver installation per process to prevent redundant initializations during repeated sampling connections. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit f9b9761f5869aab62ccd2e16320f52750beb079a in Playwright run 32946844519, attempt 1.

✅ 109 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 51m 13s

⏱️ Max setup 4m 25s · max shard execution 12m 34s · max shard-job elapsed before upload 18m 8s · reporting 7s

🌐 217.24 requests/attempt · 1.81 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 217.24 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.81 per UI scenario (228 boots / 126 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
🟡 Shard ingestion-01 43 0 1 0 0 0
✅ Shard ingestion-02 20 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Features/IncidentManager.spec.ts › Complete Incident lifecycle with table owner (shard ingestion-01, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@IceS2
IceS2 added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit 6de8d33 Aug 26, 2026
102 checks passed
@IceS2
IceS2 deleted the rca-db2-reinit-issue branch August 26, 2026 15:42
pmbrull pushed a commit that referenced this pull request Aug 27, 2026
…32154)

* fix(db2): initialize CLI driver once per process

(cherry picked from commit 3966106)

* style(db2): preserve module docstring spacing

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db2 Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DB2 profiler and auto-classification reinstall the CLI driver for every table

3 participants