Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize gateway session token logic #2146

Closed
j82w opened this issue Jan 22, 2021 · 2 comments · Fixed by #2165
Closed

Optimize gateway session token logic #2146

j82w opened this issue Jan 22, 2021 · 2 comments · Fixed by #2165

Comments

@j82w
Copy link
Contributor

j82w commented Jan 22, 2021

Currently the .NET SDK is sending the entire session token to the gateway.

  1. This adds unnecessary overhead to compute the entire session token.
  2. It causes the headers to grow to large and the service will throw a 400 bad request and will prevent users from completing requests.

Java SDK implemented a fix that needs to gets to ported to the .NET SDK.

Example of 400 error message:
Microsoft.Azure.Documents.DocumentClientException: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> <BODY><h2>Bad Request - Request Too Long</h2> <hr><p>HTTP Error 400. The size of the request headers is too long.</p> </BODY></HTML> RequestUri: https://account-westus.documents.azure.com/dbs/test/colls/test-doc/docs/BB1cXUJX; RequestMethod: GET; Header: x-ms-consistency-level Length: 7; Header: x-ms-documentdb-partitionkey Length: 12; Header: x-ms-date Length: 29; Header: authorization Length: 84; Header: x-ms-session-token Length: 15837; Header: x-ms-activity-id Length: 36; Header: Cache-Control Length: 8; Header: User-Agent Length: 72; Header: x-ms-version Length: 10; Header: Accept Length: 16; , Request URI: /dbs/amp/colls/amp-doc/docs/BB1cXUJX, RequestStats: , SDK: documentdb-dotnet-sdk/2.11.6 Host/64-bit MicrosoftWindowsNT/10.0.17763.0 at Microsoft.Azure.Documents.GatewayStoreClient.<ParseResponseAsync>d__8.MoveNext()

@kirankumarkolli
Copy link
Member

@moderakh please share the earlier PR versions also.

@moderakh
Copy link

moderakh commented Jan 22, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants