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

Missing DB connection closing #5691

Open
brevilo opened this issue Jul 17, 2024 · 3 comments
Open

Missing DB connection closing #5691

brevilo opened this issue Jul 17, 2024 · 3 comments

Comments

@brevilo
Copy link
Contributor

brevilo commented Jul 17, 2024

Various BOINC components don't properly close the DB connection they opened before. This is a problem because:

  • Open connections are a limited resource on the database server and new clients might be rejected when all are used up.
  • Left-open connections will eventually be aborted by the database server and logged as a WARNING, at least by MariaDB. MySQL still logs it as INFORMATION but MariaDB has a good reason to warn about those: the root cause can in fact be caused by misconfiguration (e.g. max_allowed_packet) or networking issues. Both should not get masked by otherwise harmless missing connection closing.

Sampling only the current C API (e.g. used by daemons), you'll find:

  • files issuing boinc_db.open(): 30
  • files issuing boinc_db.close(): 9

This indicates a general issue, not just in the C API.

Thanks

@bema-aei
Copy link
Contributor

Also the Db_conn of the web code (in html/inc/db_conn.inc) is lacking a method to close a DB connection.

@brevilo
Copy link
Contributor Author

brevilo commented Jul 17, 2024

To be fair, in a web context it might be harder to decide if and when to close a connection as you might want to reuse it (opening connections is expensive). However, when you know it can be closed, it ought to be closed.

@bema-aei
Copy link
Contributor

bema-aei commented Jul 17, 2024

There should at least be the possibility given to do it. This is a generic general purpose class, not a specific page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants