Hello
Some long-running jobs using the C++ API are getting the following GRPC errors after a few hours :
terminate called after throwing an instance of 'google::cloud::bigtable::v0::GRpcError’
what(): Table::CheckAndMutateRow(table_name=xxx) Socket closed: Table::CheckAndMutateRow(table_name=xxx) Socket closed [14=UNAVAILABLE] -
Looking at the C++ API code, it seems that the library only catches the most frequent errors, but not this one (seems that it is a PermanentMutationFailure ).
What is the right way to handle this ? How can I restart the connection and retry the mutation ?
I had at look at the GetState method inside the grpc::Channel class, but it is not clear is such code below would work :
try {
do_mutation();
}
catch (const google::cloud::bigtable::v0::GRpcError &e)
{
cout<<"Trying to restart connection"<<endl;
auto chan=client->Channel();
chan->GetState(true);
do_mutation();
}
Thanks for your help.
Bastien