I ran into this issue today, unsure of how it's caused but len(q)==1, list(q)==[] and q.peekleft() blocks infinitely (as opposed to the IndexError it's supposed to raise).
I've attached both the resolved db and the wal/shm which were there before analysis. Both versions cause the same issue.
wal-resolved.zip
wal-unresolved.zip
It seems like it loops inside _cache.peek infinitely.