2

Cassandra 2.1.15.1403 | DSE 4.8.9

Cassandra driver tested with: 2.1.2 and 3.1.7

We are using a python script to migrate some data in one of our tables. Once this is done we are closing off the connections using:

if (None != self.session):
    self.session.shutdown()
if (None != self.cluster):
    self.cluster.shutdown()

We get the below exception in cluster shutdown:

DEBUG: Closed socket to 127.0.0.1
DEBUG: Asyncore event loop stopped unexepectedly
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cassandra/io/asyncorereactor.py", line 91, in _run_loop
    asyncore.loop(timeout=0.001, use_poll=True, count=1000)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 220, in loop
    poll_fun(timeout, map)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 145, in poll
    r, w, e = select.select(r, w, e, timeout)
error: (9, 'Bad file descriptor')
DEBUG: Asyncore event loop ended

If we remove session.shutdown it works fine. Anyone has an idea about this?

Sid
  • 1,224
  • 3
  • 23
  • 48

1 Answers1

1

cluster.shutdown() is already doing a session.shutdown http://datastax.github.io/python-driver/_modules/cassandra/cluster.html#Cluster.shutdown so I don't think it's necessary to perform also a session shutdown explicitly.

Horia
  • 2,942
  • 7
  • 14