[ 
https://issues.apache.org/jira/browse/QPID-8536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17367665#comment-17367665
 ] 

ASF subversion and git services commented on QPID-8536:
-------------------------------------------------------

Commit 53a99be667f06dfbe2d3a843c538fbe918375392 in qpid-broker-j's branch 
refs/heads/main from Marek Laca
[ https://gitbox.apache.org/repos/asf?p=qpid-broker-j.git;h=53a99be ]

QPID-8536: [Broker-J] Incorrect check of maximum open connections

This closes #93


> [Broker-J] Incorrect check of maximum open connections
> ------------------------------------------------------
>
>                 Key: QPID-8536
>                 URL: https://issues.apache.org/jira/browse/QPID-8536
>             Project: Qpid
>          Issue Type: Bug
>          Components: Broker-J
>            Reporter: Marek Laca
>            Priority: Minor
>              Labels: Broker, Connections, Java, limit, port
>
> The AMQP port has the limit of maximum open connections. But this limit is 
> not checked correctly. The AMQP port has two methods 
> AmqpPort::canAcceptNewConnection and AmqpPort::incrementConnectionCount.
> Suppose that the port has the limit 5 connection and clients open 7 
> connections at the same time:
>  # 7 parallel connections is open by IO-threads.
>  # All threads call the AmqpPort::canAcceptNewConnection method and every 
> thread receive the positive answer because any connection has not been 
> registered yet.
>  # All threads call the AmqpPort::incrementConnectionCount methods. Hence the 
> connection count is increased to 7 what breaks the limits.
>  # All 7 connections are accepted in spite of breaking limit.
> The every thread can see the intermediate state of the counter when the limit 
> is checked by another thread but the counter has not been incremented yet.
>  The solution is the combination of the steps 'check' and 'increment' into 
> single atomic operation when every thread has the exclusive access to the 
> counter. The counter can be observed only in two states: 'before check' or 
> 'after incrementation'.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to