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

RateLimitException when concurrentConnectionLimitPerIp is exceeded #452

Closed
predic8 opened this issue Feb 10, 2023 · 1 comment
Closed

RateLimitException when concurrentConnectionLimitPerIp is exceeded #452

predic8 opened this issue Feb 10, 2023 · 1 comment
Milestone

Comments

@predic8
Copy link
Member

predic8 commented Feb 10, 2023

When the limit is reached in the browser the user gets just a blank screen and does not know what is going on. Add a error message so he knews whats happening.

In HttpEndpointListener, add a ProblemDetails message to the error message.

				while(true) {
					int currentConnections = connectionCount.get();
					// TODO: if count == -1 -> try to get the counter in a while loop
					if (currentConnections >= concurrentConnectionLimitPerIp) {
						log.warn(constructLogMessage(new StringBuilder(), remoteIp, readUpTo1KbOfDataFrom(socket, new byte[1023])));
						writeRateLimitReachedToSource(socket);
						socket.close();
						connnectionWithinLimit = false;
						break;
					}
					if (connectionCount.compareAndSet(currentConnections, currentConnections + 1))
						break;
				}
@predic8 predic8 added this to the 5.1.0 milestone Feb 10, 2023
@predic8
Copy link
Member Author

predic8 commented Feb 17, 2023

To count the connections the clientIP is used. What happens, when Membrane sits behind a loadbalancer and all the clientIps are the same?

predic8 added a commit that referenced this issue Feb 18, 2023
@predic8 predic8 closed this as completed Feb 18, 2023
rrayst pushed a commit that referenced this issue Feb 20, 2023
* Cleanup

* #452 connection limit default to -1

* Pair Record

* Clean up, documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant