server relax handling of op on non-existant IOID

PVA protocol has inherent races because server destroy
isn't ack'd by client.  So we must be tolerant of late
arriving messages for non-existant IOIDs.
This commit is contained in:
Michael Davidsaver
2020-01-31 14:28:30 -08:00
parent 1a286ede6e
commit 363761ab77
2 changed files with 25 additions and 9 deletions
+8 -4
View File
@@ -352,10 +352,14 @@ void ServerConn::handle_GPR(pva_app_msg_t cmd)
std::shared_ptr<ServerGPR> op;
auto it = opByIOID.find(ioid);
if(it==opByIOID.end() || !(op=std::dynamic_pointer_cast<ServerGPR>(it->second))
|| op->state==ServerOp::Dead || op->state==ServerOp::Creating) {
log_printf(connio, Err, "Client %s Gets %s IOID %u state=%d\n", peerName.c_str(),
it==opByIOID.end() ? "non-existant" : "invalid", unsigned(ioid),
if(it==opByIOID.end() || it->second->state==ServerOp::Dead) {
log_printf(connio, Debug, "Client %s Gets non-existant IOID %u\n",
peerName.c_str(), unsigned(ioid));
return;
} else if(!(op=std::dynamic_pointer_cast<ServerGPR>(it->second)) || op->state==ServerOp::Creating) {
log_printf(connio, Err, "Client %s Gets invalid IOID %u state=%d\n", peerName.c_str(),
unsigned(ioid),
op ? op->state : ServerOp::Dead);
bev.reset();
return;