Skip to content

Unreachable code in SessionTokenHelper.java line 159 #10493

@mshikaji

Description

@mshikaji

getLocalSessionToken(request, sessionToken, StringUtils.EMPTY);
request.getHeaders().remove(HttpConstants.HttpHeaders.SESSION_TOKEN);

Line 159 is unreachable because the call to getLocalSessionToken in line 158 will always result in an java.lang.IllegalStateException due to the hard-coded empty string in the 3rd parameter.

private static ISessionToken getLocalSessionToken(
RxDocumentServiceRequest request,
String globalSessionToken,
String partitionKeyRangeId) throws CosmosClientException {
if (partitionKeyRangeId == null || partitionKeyRangeId.isEmpty()) {
// AddressCache/address resolution didn't produce partition key range id.
// In this case it is a bug.
throw new IllegalStateException("Partition key range Id is absent in the context.");
}

We are experiencing the same issue in version 2.6.5 (com.microsoft.azure.cosmosdb.internal.SessionTokenHelper).

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.CosmosbugThis issue requires a change to an existing behavior in the product in order to be resolved.cosmos:v4-itemIndicates this feature will be shipped as part of V4 release traincustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions