Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Close source and target connections after executing a validation #1197

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

nj1973
Copy link
Contributor

@nj1973 nj1973 commented Jul 17, 2024

When multiple tables are validated in a single command we are building up a number of idle connections, at least in Oracle and PostgreSQL we are. Example command where ${TABLES} contains find-tables output of 23 tables:

data-validation  validate column -sc=ora_local -tc=pg_local -tbls="${TABLES}"

When I checked Oracle & PostgreSQL during the command we accumulated > 12 idle connections.

I changed the DataValidation class to support being called from a context manager and explicitly closed connections on exit. After this my test command never had more than two connections open at any time.

I also added some code to Oracle client to tag database sessions with "DVT" string.

@nj1973 nj1973 requested a review from a team as a code owner July 17, 2024 10:08
@nj1973 nj1973 linked an issue Jul 17, 2024 that may be closed by this pull request
@nj1973
Copy link
Contributor Author

nj1973 commented Jul 19, 2024

/gcbrun

Copy link
Collaborator

@helensilva14 helensilva14 left a comment

Choose a reason for hiding this comment

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

LGTM! Just added a few questions out of curiosity

third_party/ibis/ibis_oracle/__init__.py Show resolved Hide resolved
data_validation/__main__.py Show resolved Hide resolved
@helensilva14
Copy link
Collaborator

/gcbrun

@nj1973 nj1973 merged commit 3dc9fa7 into develop Jul 23, 2024
5 checks passed
@nj1973 nj1973 deleted the 1195-multi-table-validations-connection-mgmt branch July 23, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi table validations exhausted PostgreSQL connections
2 participants