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

bareos-fd-postgres: properly close database connection #1326

Merged
merged 5 commits into from
Dec 7, 2022

Conversation

lluuaapp
Copy link
Contributor

@lluuaapp lluuaapp commented Dec 1, 2022

This will properly close the database connection after a Postgres WAL backup was made. As far as I could see a call to close() is completely missing in the current code. As the the connection may already been closed I put it in a try/except to ignore all errors that may occur.

On my test system this prevents the PostgreSQL server to log

unexpected EOF on client connection with an open transaction

every backup.

  • Short description and the purpose of this PR is present
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Is the PR title usable as CHANGELOG entry?
  • Separate commit for CHANGELOG.md ("update CHANGELOG.md"). The PR number is correct.
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems

@arogge arogge self-requested a review December 2, 2022 10:17
@arogge arogge self-assigned this Dec 2, 2022
@arogge
Copy link
Member

arogge commented Dec 2, 2022

Hi,
thanks for the quick update. You provided a great improvement.
I still have to try it out and I'm not sure I'll find the time to do this today.

Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks you very much.

@arogge arogge enabled auto-merge December 5, 2022 11:27
@arogge arogge merged commit 91f55eb into bareos:master Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants