I doubt anyone is interested in helping diagnose a bug in a multithreaded 
application, but I was hoping someone instead might be able to provide some 
additional insight into a pytables error message.

I have a multithreaded application which uses Parallel Python 
(http://www.parallelpython.com) to analyze data in seperate processes, so it 
takes advantage of multiple CPUs and is truly concurrent. The results of the 
analysis are returned and I update my pytables file, which I think I have 
adequately protected with a mutex lock.

After many iterations, I eventually get an error message that I am having 
trouble understanding:

----------------- 

Unhandled exception in thread started by
Traceback (most recent call last):
  File "/usr/lib64/python2.5/site-packages/pp.py", line 494, in __run
    job.finalize(sresult)
  File "/usr/lib64/python2.5/site-packages/pp.py", line 53, in finalize
    self.__unpickle()
  File "/usr/lib64/python2.5/site-packages/pp.py", line 82, in __unpickle
    self.callback(*args)
  
File 
"/home/darren/src/xpaxs/xpaxs-reorg/xpaxs/spectromicroscopy/advancedfitanalysis.py",
 
line 249, in updateRecords

  File "/usr/lib/python2.5/site-packages/tables/group.py", line 854, in 
__getattr__
    return self._f_getChild(name)
  File "/usr/lib/python2.5/site-packages/tables/group.py", line 736, in 
_f_getChild
    return self._v_file._getNode(childPath)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 918, in 
_getNode
    parentNode = self._reviveNode(parentPath)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2219, in 
_reviveNode
    node = self._deadNodes.pop(nodePath)
  File "/usr/lib/python2.5/site-packages/tables/misc/lrucache.py", line 201, 
in pop
    self.__heap.remove(node)
ValueError: list.remove(x): x not in list

-------------

When I close my application, I get some additional output:

-------------

Closing remaining open files: /home/darren/citrus_leaves.mca.h5... Error in 
atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.5/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2255, in 
close_open_files
    fileh.close()
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2064, in close
    lambda path: self._reviveNode(path))
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2021, in 
_closeNodes
    node = getNode(nodePath)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2064, in 
<lambda>
    lambda path: self._reviveNode(path))
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2216, in 
_reviveNode
    "trying to revive non-dead node ``%s``" % nodePath
AssertionError: trying to revive non-dead node 
``/scan5/elementMaps/MassFraction/BrK``
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib64/python2.5/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2255, in 
close_open_files
    fileh.close()
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2064, in close
    lambda path: self._reviveNode(path))
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2021, in 
_closeNodes
    node = getNode(nodePath)
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2064, in 
<lambda>
    lambda path: self._reviveNode(path))
  File "/usr/lib/python2.5/site-packages/tables/file.py", line 2216, in 
_reviveNode
    "trying to revive non-dead node ``%s``" % nodePath
AssertionError: trying to revive non-dead node 
``/scan5/elementMaps/MassFraction/BrK``

-------------

Does anyone have any thoughts? If I serialize the update of the pytables 
object, I am able to process the entire data set without any error messages. 
Does anyone have experience working with pytables in a multithreaded app that 
can describe any gotchas? 

Thank you,
Darren

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to