What is header caching in Spray?

We tried to find a very elusive error in one of our systems, where we get an error 400 Bad Requestafter several requests to the server. Finally, we tracked it before caching the HTTP header in Spray, for some reason the variable nodeCountin is HttpHeaderParserset to> 32k, which, since it is later converted to Short, leads to overflow results.

We fixed the issue by disabling HTTP header caching ( spray.can.server.parsing.header-cache.default = 0). We tried to create a reproducible minimal design, but failed.

My question is, what effects can we expect from completely disabling header caching? I really donโ€™t understand why this is even necessary, since the headers should be processed in any case in each request (since the values โ€‹โ€‹can be changed). Is memory saved by reusing objects HttpHeader?

+4
source share

Source: https://habr.com/ru/post/1605750/


All Articles