My favorites | Sign in
Project Home
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 204: KeyError when resolving conflicts
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  kxepal
Closed:  Oct 2012


Sign in to add a comment
 
Reported by d...@playcanvas.com, Nov 16, 2011
What steps will reproduce the problem?
1. Run the attached script couch.py

What is the expected output? What do you see instead?
I expect to see conflicts resolved resulting in doc with value=10
Instead I get KeyError: 'http://localhost:5984/keyerror_test/test'
from:
/couchdb/http.py", line 251, in request
    del self.cache[url]

What version of the product are you using? On what operating system?
couchdb-python 0.8, python 2.7, Ubuntu 11.04

Please provide any additional information below.

I can fix this issue by changing lint 251 of http.py to 

try:
    del self.cache[url]
except KeyError, e:
    pass

I guess this is a threading issue as self.cache has been altered between line 165 and line 251. Is it even valid to use couchdb-python in this way?

Note, I originally discovered this in my Pylons web app when I would get this exception during a Mapping.load(db, id) call.
couch.py
585 bytes   View   Download
Nov 16, 2011
#1 matt.goo...@gmail.com
couchdb.http.Session does attempt to be thread-safe so I'd definitely say you're using it just fine and this is a bug. Thanks for reporting!
Sep 21, 2012
Project Member #2 djc.ochtman
(No comment was entered for this change.)
Owner: kxepal
Sep 21, 2012
#3 wickedg...@gmail.com
(No comment was entered for this change.)
Labels: Milestone-0.9
Oct 5, 2012
#4 kxepal
Fixed in r4c4d3ecf896b
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting