ItemAllocator class can throw a ValueError when file is corrupted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
High
|
Brian Haley |
Bug Description
While running tests for an unrelated change, I saw this failure:
neutron.
-------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "neutron/
File "neutron/
FIP_PR_END)
File "neutron/
pool)
File "neutron/
key, saved_value = line.strip(
ValueError: need more than 1 value to unpack
This is due to the fact that all the tests in this file using the ItemAllocator class are using/re-using the same files in /tmp, and when the right ones are run simultaneously, the file can be truncated, leading to a corruption. To recreate it you just have to do this:
$ echo "111.2.3.466652" > /tmp/fip-priorities
$ tox -e py27 neutron.
So the tests need to change to use unique files, and clean them up on exit.
But it also shows that the ItemAllocator class cannot deal with a corrupt file. In this case we should catch the error and skip the invalid entry, since it could cause the l3-agent to not start.
The same is probably true of other files in /tmp the tests are using as well.
i can reproduce as well. thanks for the easy steps to follow :)