Skip to content

Commit

Permalink
IMPALA-312 add try/catch for state store rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
alanchoi authored and lskuff committed Apr 29, 2013
1 parent 6f2b0a0 commit 3a24e07
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion be/src/statestore/state-store-subscriber.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,17 @@ Status StateStoreSubscriber::Register() {
request.subscriber_location = heartbeat_address_;
request.subscriber_id = subscriber_id_;
TRegisterSubscriberResponse response;
client->RegisterSubscriber(response, request);
try {
client->RegisterSubscriber(response, request);
} catch (apache::thrift::transport::TTransportException& e) {
// Client may have been closed due to a failure
RETURN_IF_ERROR(client.Reopen());
try {
client->RegisterSubscriber(response, request);
} catch (apache::thrift::transport::TTransportException& e) {
return Status(e.what());
}
}
Status status = Status(response.status);
if (status.ok()) connected_to_statestore_metric_->Update(true);
heartbeat_interval_timer_.Start();
Expand Down

0 comments on commit 3a24e07

Please sign in to comment.