You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On line 45 of cowboy_fastcgi_handler.erl the line says
RequestId=MicroSecsrem65535,
where RequestId is subsequently used for uniquely identifying a FastCGI request. However, if I'm reading this right, there's 1 in 65536 chance that current request might have the same ID as the previous one. The likelihood of having a duplicate ID goes up as the number of concurrent requests to the application go up.
Simple but not entirely foolproof solution - just increment the previous ID, then wrap around when you reach 2^16.
The text was updated successfully, but these errors were encountered:
You might have a point and we could use ets:update_counter for such a thing, but a few points can be made:
The requests have to start at exactly the same microsecond for this to be an issue (which is unlikely, at first). But also, I doubt that under those circumstances this is your main problem, because that would mean that there are way too many requests to deal with in a given second, and can easily exceed the capacity of 65535 requests per worker (it doesn't matter how you'd like to count them because that's the limit per worker, 65535).
This is only a sample application, with the sole purpose of illustrating how one could use erl_fastcgi, and not a real world application suitable for production :)
On line 45 of
cowboy_fastcgi_handler.erl
the line sayswhere
RequestId
is subsequently used for uniquely identifying a FastCGI request. However, if I'm reading this right, there's 1 in 65536 chance that current request might have the same ID as the previous one. The likelihood of having a duplicate ID goes up as the number of concurrent requests to the application go up.Simple but not entirely foolproof solution - just increment the previous ID, then wrap around when you reach 2^16.
The text was updated successfully, but these errors were encountered: