Page MenuHomePhabricator

Regression: lost the ability to --dump-db-postrun
Closed, ResolvedPublic


There used to be code which help a reference open to the backend database. Parts of this are RAII so destruction makes it impossible to work further with the database.

Probably, this was broken by my refactors. Restore!

See @hashar comments on :

Broken since a663ad60cdffee3a19bee43c5b4a0bd0bd60f25a /

That breaks notably --dump-db-postrun

INFO:quibble.cmd:<<< Finish: Run tests in mediawiki/core: , in 0.107 s
INFO:backend.MySQL:Dumping database to /home/hashar/workspace/log/mysqldump.sql
Exception ignored in: <function MySQL.__del__ at 0x7fd20f528598>
Traceback (most recent call last):
  File "/home/hashar/projects/integration/quibble/quibble/", line 294, in __del__
  File "/home/hashar/projects/integration/quibble/quibble/", line 137, in stop
  File "/home/hashar/projects/integration/quibble/quibble/", line 278, in dump
NameError: name 'open' is not defined

With python 3.7

Event Timeline

hashar added a subscriber: hashar.

Change 604380 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/quibble@master] Fix database dumping

hashar triaged this task as Medium priority.

Somehow now by the time MySQL.__del__ is invoked, the open built-in is already garbage collected. It seems weakref.finalize() is not affected and is the recommended way of handing it.

Change 604380 merged by jenkins-bot:
[integration/quibble@master] Fix database dumping

Pending next release of Quibble

hashar changed the task status from Open to Stalled.Aug 19 2020, 5:12 PM

Change 628138 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/quibble@master] Release Quibble 0.0.45

Change 628138 merged by jenkins-bot:
[integration/quibble@master] Release Quibble 0.0.45

And that has been released with 0.0.45.