Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #357. #358

Merged
merged 1 commit into from
Jun 10, 2013
Merged

Fix for Issue #357. #358

merged 1 commit into from
Jun 10, 2013

Conversation

eandersson
Copy link
Contributor

There is probably a better approach to fixing this, as it could be a logic issue, but I think this is an acceptable solution.

Removing self.socket = None from _adapter_disconnect yields the same result as checking for it to be None in close(), but as I don't know if that affects other parts of the library, I decided against changing it.

New output when the server becomes unreachable (e.g. server is shutdown) with the suggested fix.

DEBUG:Incremented callback reference counter: {'callback': <bound method BlockingChannel._on_rpc_complete of <pika.adapters.blocking_connection.BlockingChannel object at 0xb74e6b8c>>, 'only': None, 'one_shot': True, 'arguments': None, 'calls': 3}
ERROR:Socket Error on fd 3: 104
WARNING:Socket closed when connection was open
DEBUG:Added: {'callback': <bound method BlockingConnection._on_connection_start of <pika.adapters.blocking_connection.BlockingConnection object at 0x8b920ac>>, 'only': None, 'one_shot': True, 'arguments': None, 'calls': 1}
CRITICAL:Attempted to send frame when closed
CRITICAL:Attempted to send frame when closed
Traceback (most recent call last):
  File "/home/eandersson/repo/x/t2.py", line 19, in <module>
    print channel.basic_publish(exchange='', routing_key='hello', body='Hello World!')
  File "/usr/local/lib/python2.7/dist-packages/pika-0.9.13-py2.7.egg/pika/adapters/blocking_connection.py", line 522, in basic_publish
    (properties, body))
  File "/usr/local/lib/python2.7/dist-packages/pika-0.9.13-py2.7.egg/pika/adapters/blocking_connection.py", line 1107, in _rpc
    self.connection.process_data_events()
  File "/usr/local/lib/python2.7/dist-packages/pika-0.9.13-py2.7.egg/pika/adapters/blocking_connection.py", line 219, in process_data_events
    raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed

gmr pushed a commit that referenced this pull request Jun 10, 2013
@gmr gmr merged commit 4624ab9 into pika:master Jun 10, 2013
@gmr
Copy link
Member

gmr commented Jun 10, 2013

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants