husio / python-sqlite3-backup

Sqlite3 online API CPython implementation module
http://pypi.python.org/pypi/sqlitebck/
42 stars 9 forks source link

Copy hangs in endless sleep state #14

Closed a1an77 closed 6 years ago

a1an77 commented 6 years ago

With version 1.3 often copying a 2.6 GB database file to a memory database hangs up indefinitely (interrupted after 16 hours) instead of taking a few minutes to complete. The problem appears intermittently and I've not been able to pinpoint a specific cause. The file lies on an NFS network if that might contribute to the behaviour. There are no other processes accessing the file at the same time and the memory db is private to the thread. Using version 1.2.1 works flawlessly

PS: I suspect that for some reason the copy loop gets stuck into an SQLITE_LOCKED issue with itself, ending up sleeping indefinitely

husio commented 6 years ago

Thanks for the report. This sounds like a regression that is not covered by tests. I will give it a try on the weekend.

husio commented 6 years ago

How do you call copy function?

Can you check if you have the same issue when using https://github.com/husio/python-sqlite3-backup/pull/15 ?

a1an77 commented 6 years ago

I call it in an instance method with

sqlitebck.copy(sqliteFile, self.sqlite)

where self.sqlite is an in-memory instance How can I test using #15 ?

husio commented 6 years ago

You have to pip install pointing directly at this hash, I believe it will be:

$ pip install git+git://github.com/husio/python-sqlite3-backup@b7ea6a5d6024d95c55d35f0d806144088f516edb

Then run your script as usual.

Let me know if you have any troubles.

a1an77 commented 6 years ago

Seems to work again now!

husio commented 6 years ago

I have merged and released this as 1.4. Please make sure this version works for you as well and then I will close this issue.

a1an77 commented 6 years ago

Worked good five times in a row so I would confirm