Ehsan created CASSANDRA-9246:
--------------------------------

             Summary: Cassandra driver becomes unresponsive after two 
exceptions are raised
                 Key: CASSANDRA-9246
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9246
             Project: Cassandra
          Issue Type: Bug
          Components: Core
         Environment: os: both win and linux
framework: tested on both express and total.js frameworks
            Reporter: Ehsan
            Priority: Critical
             Fix For: 2.0.1
         Attachments: nodetest1.7z, result.png

The driver becomes unresponsive when two two exception are raised inside the 
Cassandra driver's response callback.

how to reproduce:
1- setup a typical express (or total.js) project

2- add a simple route:
{code:JavaScript}
app.use('/test', test);
{code}

3- code the route:
{code:JavaScript}
var cassandra = require('cassandra-driver');
var contactPoints = ['cassandra-dev.nikoo.ir'];

var driver = new cassandra.Client({
  contactPoints: contactPoints,
  keyspace: 'nikoomail',
  queryOptions: {prepare: true},
  socketOptions: {connectTimeout: 10000}
});

router.get('/', function(req, res, next) {

  console.log();
  console.log('-> Before executing the query');

  driver.execute('SELECT * FROM domain', [], function(err, result) {

    console.log('-> After executing the query');

    res.send('respond with a resource');

    throw new Error('Raising an exception here <--');
  });
});
{code}

4- add a global exception handler:
{code:JavaScript}
process.on('uncaughtException', function(err) {
  console.error(err);
});
{code}

5- run the project:
npm start

6- navigate to http://localhost:300/test, notice the route works and the 
"respond with a resource" is seen

7- redo step (6), 

8- for a third time repeat step (6) and notice the driver does not respond 
anymore and consequently nothing is received on the client side.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to