[ 
https://issues.apache.org/jira/browse/QPID-3218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031201#comment-13031201
 ] 

Gordon Sim commented on QPID-3218:
----------------------------------

I believe what is happening here is that a session_dectahed can result in the 
SessionState being removed from the attachments map, but the Engine.attach() 
method will proceed regardless of that fact and may then hit these types of 
errors on any linking/unlinking work. This certainly explains my case above and 
could explain the original trace. It would however most likely be accompanied 
by some error in the broker logs.

Suggested fix:

{noformat}
Index: qpid/messaging/driver.py
===================================================================
--- qpid/messaging/driver.py    (revision 1097458)
+++ qpid/messaging/driver.py    (working copy)
@@ -828,8 +828,9 @@
     self._closing = True
 
   def attach(self, ssn):
+    if ssn.closed: return
     sst = self._attachments.get(ssn)
-    if sst is None and not ssn.closed:
+    if sst is None:
       for i in xrange(0, self.channel_max):
         if not self._sessions.has_key(i):
           ch = i
{noformat}

> AttributeError: 'NoneType' object has no attribute 'write_cmds'
> ---------------------------------------------------------------
>
>                 Key: QPID-3218
>                 URL: https://issues.apache.org/jira/browse/QPID-3218
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Client
>    Affects Versions: 0.7
>         Environment: OS=RHEL6 
> python-qpid-0.7.946106-12.el6.noarch
> qpid-cpp-client-0.7.946106-5.el6.x86_64
> qpid-cpp-server-0.7.946106-5.el6.x86_64
> qpid broker on main server and all the nodes are
> vm's with bridged configuration in a single network.
>            Reporter: Jeff Ortel
>         Attachments: test.py
>
>
> 2011-04-19 22:05:07,321 [ERROR][asynctaskreplyqueue] __fetch() @ 
> consumer.py:90 - asynctaskreplyqueue
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/gofer/messaging/consumer.py", line 
> 86, in __fetch
>     return self.receiver.fetch(timeout=self.WAIT)
>   File "<string>", line 6, in fetch
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 994, in fetch
>     self._ecwait(lambda: self.linked)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 50, in _ecwait
>     result = self._ewait(lambda: self.closed or predicate(), timeout)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 957, in _ewait
>     result = self.session._ewait(lambda: self.error or predicate(), timeout)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 550, in _ewait
>     result = self.connection._ewait(lambda: self.error or predicate(), 
> timeout)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 194, in _ewait
>     self.check_error()
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
> 187, in check_error
>     raise self.error
> InternalError: Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 496, 
> in dispatch
>     self.engine.dispatch()
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 791, 
> in dispatch
>     self.attach(ssn)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 834, 
> in attach
>     self.link(rcv, self._in, rcv.source)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 885, 
> in link
>     dir.do_unlink(sst, lnk, _lnk)
>   File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 261, 
> in do_unlink
>     sst.write_cmds(cmds, action)
> AttributeError: 'NoneType' object has no attribute 'write_cmds'

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to