Double submitting to callback?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Twisted |
New
|
Unknown
|
|||
pkgme service |
Fix Released
|
High
|
James Westby |
Bug Description
[2012-02-29 18:09:26,199: INFO/MainProcess] Got task from broker: djpkgme.
[2012-02-29 18:09:26,200: INFO/PoolWorker-1] djpkgme.
[2012-02-29 18:09:28,438: INFO/PoolWorker-1] djpkgme.
[2012-02-29 18:09:28,493: ERROR/MainProcess] Task djpkgme.
Traceback (most recent call last):
File "/usr/lib/
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/lib/
return self.run(*args, **kwargs)
File "/home/
submit_
File "/home/
return submit_
File "/home/
url, method='PUT', headers=headers, body=json_body)
File "/usr/lib/
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/
(response, content) = self._conn_
File "/usr/lib/
conn.connect()
File "/usr/lib/
raise socket.error, msg
error: [Errno 111] Connection refused
Traceback (most recent call last):
File "/usr/lib/
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/lib/
return self.run(*args, **kwargs)
File "/home/
submit_
File "/home/
return submit_
File "/home/
url, method='PUT', headers=headers, body=json_body)
File "/usr/lib/
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/
(response, content) = self._conn_
File "/usr/lib/
conn.connect()
File "/usr/lib/
raise socket.error, msg
error: [Errno 111] Connection refused
Trying current trunk on ec2. The harness successfully shows the callback info, so it looks
like this is failing because it is sending the callback twice?
Thanks,
James
Changed in twisted: | |
status: | Unknown → New |
Changed in pkgme-service: | |
status: | Fix Committed → Fix Released |
I don't think so. If you change the harness so that it doesn't shut down when it gets a response, you'll see that only one request is ever sent to it. I think the problem is that we are shutting down the service too early.
From #twisted.web on 2012-01-12:
jml: When is Resource.render() called? callLater( 0, ...) to the rescue :(
exarkun: When a Resource is found to service a request
jml: is the request fully received by that point?
exarkun: Yes
jml: OK, thanks.
jml: I have a Resource locally that waits for one request and then shuts down the web server. However, the other end is reporting a connection refused after sending the request. I can't figure out what this second attempted connection is all about.
exarkun: favicon? :)
exarkun: You may also be shutting down the reactor such that the response is never sent, and some kind of retry logic in the client is kicking in.
jml: exarkun: ooh, that last one might be it.
jml: exarkun: is there an event I can hook into to ensure the response has been sent?
exarkun: :(
exarkun: not as far as I know
jml: exarkun: how vexing.
jml: I'm currently starting the shutdown on notifyFinish
exarkun: Yea, you'd sorta expect that to be good enough.
jml: I'll try a callLater to verify that this is indeed what's happening.
jml: reactor.