2016-09-14 2 views
0

私は現在、データをcassandraに保存するAPIエンドポイントで負荷テストを行っています。一般的にはそれがうまく動作しますが、私は非同期挿入操作を実行するとき、私はエラーコールバックに次のメッセージを取得する:エラーコールバックハンドラでCassandra Python Driverエラーコールバックにエラーが表示されない

query_template = self.query_template(table, columns, values, ttl, insertion_timestamp) 

statement = self.session.prepare(query_template) 
statement.consistency_level = self.write_consistency_level 
batch = BatchStatement(batch_type=BatchType.UNLOGGED, retry_policy=RetryPolicy.RETRY, 
          consistency_level=self.write_consistency_level) 
for elem in list_of_dictionary: 
    values = [elem[key] for key in field_list] 
    batch.add(statement, values) 

if async: 
    future = self.session.execute_async(batch, values) 
    future.add_errback(error_handler, batch) 
else: 
    self.session.execute(batch, values) 

ERROR:root:Query '<BatchStatement type=UNLOGGED, statements=382, consistency=ONE>' failed: errors={}, last_host=XXXXX 

私は、バッチは、以下の方法を挿入し実行します:

def default_error_handler(exc, batch): 
    """ 
    Default callback function that is triggered when the cassandra async operation failed 
    :param exception: 
    """ 

    logging.error("Query '%s' failed: %s", batch, exc) 

誰か手掛かりがありますか?

答えて

0

私はこの問題を発見しました。

タイプOperationTimedOutのクライアント側エラーです。あなたはここでそれを見つけることができます。

https://github.com/datastax/python-driver/blob/1fd961a55a06a3ab739a3995d09c53a1b0e35fb5/cassandra/init.py

私はほかにこの

def default_error_handler(exc, batch): 
    """ 
    Default callback function that is triggered when the cassandra async operation failed 
    :param exception: 
    """ 


    logging.error("Batch '%s' failed with exception '%s' of type '%s' ", batch, exc, type(exc)) 

のようなあなたのコールバックハンドラで例外の種類は、私は今、私たちの問題を解決しようとログインすることをお勧め!

関連する問題