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

Can't dequeue corrupted pickle item #142

Open
PhracturedBlue opened this issue Nov 10, 2020 · 3 comments
Open

Can't dequeue corrupted pickle item #142

PhracturedBlue opened this issue Nov 10, 2020 · 3 comments

Comments

@PhracturedBlue
Copy link

Persist-Queue 0.5.0
I don't know how I got into this state, but I have a corrupted queue that I cannot remove items from.

>>> import persistqueue
>>> q = persistqueue.Queue("/tmp/elastic.e6c64f88.queue")
>>> q.qsize()
234
>>> q.get()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/maap/.venv/lib/python3.7/site-packages/persistqueue/queue.py", line 216, in get
    item = self._get()
  File "/var/lib/maap/.venv/lib/python3.7/site-packages/persistqueue/queue.py", line 230, in _get
    data = self.serializer.load(self.tailf)
  File "/var/lib/maap/.venv/lib/python3.7/site-packages/persistqueue/serializers/pickle.py", line 28, in load
    return pickle.load(fp)
_pickle.UnpicklingError: could not find MARK

I can clearly wipe the queue, but I don't think this should be able to happen in the 1st place

@peter-wangxu
Copy link
Owner

is there any power failure or disk failure on your machine?

@PhracturedBlue
Copy link
Author

It is very unlikely there was a hardware reboot, but I can't rule it out. This software runs on hundreds of machines in an enterprise environment and the issue was several months ago. In 99% of our systems, a reboot would wipe /tmp, so the queue qouldn't be there, but there is a small chance we had a reboot on one of the systems that preserves /tmp. There is no realistic possibility of us having a disk failure as that would trigger alerts and a hardware service request.

Regardless, I don' t think this behavior would be expected. Either the quese should be corrupt enough that it is unreadable, or it should be accessible.

@peter-wangxu
Copy link
Owner

Yes, it's not acceptable that power failure crash the queue meta info file.

I saw another similar issue occurred, will investigate more on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants