augur icon indicating copy to clipboard operation
augur copied to clipboard

This function is one of the worst for database leaks

Open MoralCode opened this issue 2 weeks ago • 3 comments

https://github.com/chaoss/augur/blob/34f5644e2738c91d2f6b2a4ce81035fa201d9094/augur/tasks/init/init.py#L7

every time this is called, a DB connection is opened that never gets closed. This should not be happening. This has been looked at by several maintainers several times

We need tests and stuff to confirm this

MoralCode avatar Dec 10 '25 01:12 MoralCode

I think co-pilot found the missing indentation for this problem:

https://github.com/chaoss/augur/pull/3456/commits/2f1a56142690a69e46e039e3be82374033051b12

sgoggins avatar Dec 11 '25 21:12 sgoggins

I really dont think thats the answer

MoralCode avatar Dec 11 '25 23:12 MoralCode

My plan:

  1. Wait for database stuff to be fixed/merged
  2. Fix database test fixtures in unit tests
  3. Create unit test confirming one connection is leaked every time the function in this issue runs
  4. Experiment with fixes until the test passes

MoralCode avatar Dec 11 '25 23:12 MoralCode