skoppu22 commented on code in PR #340:
URL: https://github.com/apache/cassandra-sidecar/pull/340#discussion_r3173317677
##########
server/src/main/java/org/apache/cassandra/sidecar/handlers/validations/ValidateTableExistenceHandler.java:
##########
@@ -97,12 +103,19 @@ protected void handleInternal(RoutingContext context,
}
TableMetadata tableMetadata = keyspaceMetadata.getTable(table);
- if (tableMetadata == null)
+ boolean tableExists = tableMetadata != null;
+ if (!tableExists)
+ {
+ tableExists = driverUnsupportedSchemaCache.getTableSchema(new
Name(keyspaceMetadata.getName()),
+ new
Name(table),
+
false) != null;
+ }
+ if (!tableExists)
{
String errMsg = "Table " + input.tableName() + " was not found
for keyspace " + input.keyspace();
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND,
errMsg));
}
- else
+ else if (tableMetadata != null)
Review Comment:
There is no else part below (i.e, no case handling tableMetadata = null) and
context.next() or context.fail() not called in that case and handler will hang
until timeout.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]