DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

emile.salem_166018 avatar image
emile.salem_166018 asked ·

Node.js driver IdempotenceAwareRetryPolicy generating undefined error?

Context: https://github.com/datastax/nodejs-driver/blob/master/lib/policies/retry.js#L185

on line 186 and 200 we try using the 'options' property of an OperationInfo type variable.

The OperationInfo type doesnt have an 'options' property (according to the documentations)


TypeError: Cannot read property 'isIdempotent' of undefined
at IdempotenceAwareRetryPolicy.onRequestError (/usr/src/app/node_modules/cassandra-driver/lib/policies/retry.js:170:20)
at RequestExecution._getDecision (/usr/src/app/node_modules/cassandra-driver/lib/request-execution.js:286:30)
at RequestExecution._handleError (/usr/src/app/node_modules/cassandra-driver/lib/request-execution.js:238:31)
at _operation._connection.sendStream (/usr/src/app/node_modules/cassandra-driver/lib/request-execution.js:119:23)
at OperationState (/usr/src/app/node_modules/cassandra-driver/lib/connection.js:478:5)
at OperationState._swapCallbackAndInvoke (/usr/src/app/node_modules/cassandra-driver/lib/operation-state.js:145:5)
at OperationState._markAsTimedOut (/usr/src/app/node_modules/cassandra-driver/lib/operation-state.js:118:10)
at Timeout.requestTimedOut [as _onTimeout] (/usr/src/app/node_modules/cassandra-driver/lib/operation-state.js:92:12)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
node.js
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thank you for the clear error report with a stack trace!

1 Like 1 · ·

1 Answer

jorgebg avatar image
jorgebg answered ·

Nice findings! Its a bug, I've filed a ticket for it: https://datastax-oss.atlassian.net/browse/NODEJS-541


In any case, IdempotencyAwareRetryPolicy is deprecated since v4.0 and shouldn't be used as the doc states:

The configured RetryPolicy is not engaged when a query errors with a WriteTimeoutException or request error and the query was not idempotent.

You can use the default retry policy, that will have the same effect.


Thanks!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.