PermissionError for lock file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
twisted (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
MAAS uses twisted and we have ran into an issue where it seems to be that the MAAS's networking monitoring services has a lock file to ensure that only one processes updates the networking information. If the processes gets killed, the lock file stays, pointing to the PID the killed regiond process had.
Now what normally happens is that another process tries to acquire the lock, sees that the lock points to a killed PID , and recreates the lock.
This normally works, but what can happen is that the killed PID gets recycled, so that the lock now points to a PID which the maas user isn't allowed to kill. Now a PermissionError is raised, that the lock file implementation doesn't handle this case, and the networking monitoring service can never start.
Here is the traceback:
2019-10-31 08:12:13 twisted.scripts: [info] twistd 17.9.0 (/usr/bin/python3 3.6.8) starting up.
2019-10-31 08:12:13 twisted.scripts: [info] reactor class: twisted.
2019-10-31 08:12:14 -: [critical] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/
self()
File "/usr/lib/
d = defer.maybeDefe
File "/usr/lib/
result = f(*args, **kw)
File "/usr/lib/
return _inlineCallback
--- <exception caught here> ---
File "/usr/lib/
result = g.send(result)
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
if not self._fslock.
File "/usr/lib/
Different code path but a similar error with kill throwing a PermissionError in https:/ /bugs.launchpad .net/ubuntu/ +source/ twisted/ +bug/512708