limscoder / amfast

An Adobe AMF serialization and RPC implementation for Python, written as a C extension for speed.
MIT License
5 stars 6 forks source link

solved KeyError in memcache_manager.py #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
when publishing some messages, I got an error:

[Wed Nov 23 16:36:18 2011] [error] # ---- Type ---- #
[Wed Nov 23 16:36:18 2011] [error] KeyError
[Wed Nov 23 16:36:18 2011] [error] # ---- Detail ---- #
[Wed Nov 23 16:36:18 2011] [error] '_lock_ROOMID-16__messages'
[Wed Nov 23 16:36:18 2011] [error] # ---- Traceback ---- #
[Wed Nov 23 16:36:18 2011] [error]   File "D:\\Program 
Files\\Python26\\lib\\site-packages\\amfast-0.5.3-py2.6-win32.egg\\amfast\\remot
ing\\channel.py", line 399, in publishMessage
[Wed Nov 23 16:36:18 2011] [error]     
self.subscription_manager.publishMessage(msg)
[Wed Nov 23 16:36:18 2011] [error] -
[Wed Nov 23 16:36:18 2011] [error]   File "D:\\Program 
Files\\Python26\\lib\\site-packages\\amfast-0.5.3-py2.6-win32.egg\\amfast\\remot
ing\\subscription_manager.py", line 60, in publishMessage
[Wed Nov 23 16:36:18 2011] [error]     self.persistMessage(msg)
[Wed Nov 23 16:36:18 2011] [error] -
[Wed Nov 23 16:36:18 2011] [error]   File "D:\\Program 
Files\\Python26\\lib\\site-packages\\amfast-0.5.3-py2.6-win32.egg\\amfast\\remot
ing\\memcache_subscription_manager.py", line 271, in persistMessage
[Wed Nov 23 16:36:18 2011] [error]     self._lock.release(lock_name)
[Wed Nov 23 16:36:18 2011] [error] -
[Wed Nov 23 16:36:18 2011] [error]   File "D:\\Program 
Files\\Python26\\lib\\site-packages\\amfast-0.5.3-py2.6-win32.egg\\amfast\\remot
ing\\memcache_manager.py", line 35, in release
[Wed Nov 23 16:36:18 2011] [error]     del self.acquired_locks[key]
[Wed Nov 23 16:36:18 2011] [error] 

Maybe, the key has been deleted by other thread or something,so I add a If 
condition to solve this.
like this:

            if key in self.acquired_locks:
                del self.acquired_locks[key]

What version of the product are you using? On what operating system?
env :apache in win2003

Please provide any additional information below.

Original issue reported on code.google.com by qihan...@gmail.com on 23 Nov 2011 at 9:25

GoogleCodeExporter commented 9 years ago
This issue is already fixed in trunk

Original comment by dthomp...@gmail.com on 3 Dec 2011 at 11:14

GoogleCodeExporter commented 9 years ago
But I still got an keyerror~
How is this possible?

Original comment by qihan...@gmail.com on 6 Dec 2011 at 3:05

GoogleCodeExporter commented 9 years ago
I think you must have been using an older version of the code.

Original comment by dthomp...@gmail.com on 6 Dec 2011 at 5:30