Permission denied and lock issue with multiprocess logging


D

david dani

When i am running the implementation of multiprocess logging through
queue handler, i get this error. It is the same with sockethandler as
well as with pipe handler if multiprocesses are involved. I am not
getting any hint to solve this problem. Please help to solve the
problem.

Platform: AIX
Python version:2.6.5

sem_trywait: Permission denied
sem_post: Permission denied
sem_destroy: Permission denied
sem_wait: Permission denied
Process Process-1:
Traceback (most recent call last):
File "/opt/freeware/lib/python2.6/multiprocessing/process.py", line
232, in _bootstrap
self.run()
File "/opt/freeware/lib/python2.6/multiprocessing/process.py", line
88, in run
self._target(*self._args, **self._kwargs)
File "mplog.py", line 108, in listener_process
configurer()
File "mplog.py", line 99, in listener_configurer
h = logging.handlers.RotatingFileHandler('/tmp/mptest.log', 'a', 300,
10)
File "/opt/freeware/lib/python2.6/logging/handlers.py", line 107, in
__init__
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
File "/opt/freeware/lib/python2.6/logging/handlers.py", line 59, in
__init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/opt/freeware/lib/python2.6/logging/__init__.py", line 819, in
__init__
StreamHandler.__init__(self, self._open())
File "/opt/freeware/lib/python2.6/logging/__init__.py", line 744, in
__init__
Handler.__init__(self)
File "/opt/freeware/lib/python2.6/logging/__init__.py", line 605, in
__init__
_releaseLock()
File "/opt/freeware/lib/python2.6/logging/__init__.py", line 208, in
_releaseLock
_lock.release()
File "/opt/freeware/lib/python2.6/threading.py", line 138, in release
raise RuntimeError("cannot release un-acquired lock")
RuntimeError: cannot release un-acquired lock
sem_trywait: Permission denied
 
Ad

Advertisements

V

Vinay Sajip

When i am running the implementation of multiprocessloggingthrough
queue handler, i get this error. It is the same with sockethandler as
well as with pipe handler if multiprocesses are involved. I am not
getting any hint to solve this problem. Please help to solve the
problem.

There is an old bug on AIX which might be relevant, see

http://bugs.python.org/issue1234

It depends on how your Python was built - see the detailed comments
about how Python should be configured before being built on AIX
systems.

N.B. This error has nothing to do with logging - it's related to
semaphore behaviour in the presence of fork(), which of course happens
in multiprocessing scenarios.

Regards,

Vinay Sajip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top