-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
IGNITE-20424 Added client session outbound queue size limit. #10980
Conversation
cc06f04
to
6102e95
Compare
} | ||
|
||
/** */ | ||
GridNioServer<ClientMessage> nioServer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that introducing a getter just for test purposes is not needed. You can get this field by reflection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Let's use reflection. PR has been updated accordingly.
Collection<IgniteClientFuture<byte[]>> futs = ConcurrentHashMap.newKeySet(); | ||
|
||
try { | ||
while (cliDisconnectedLatch.getCount() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These curly braces are redundant, according to our codestyle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
skipClientWrite(grid(0), true); | ||
|
||
Collection<IgniteClientFuture<byte[]>> futs = ConcurrentHashMap.newKeySet(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us add some descriptions of what is going on in this test (i.e. flooding with get requests, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is ok, except few minor issues.
a15e643
to
b340947
Compare
b340947
to
0f22559
Compare
* @return {@code this} for chaining. | ||
*/ | ||
public ClientConnectorConfiguration setSessionOutboundMessageQueueLimit(int sesOutboundMsgQueueLimit) { | ||
A.ensure(sesOutboundMsgQueueLimit > 0, "Session outbound queue limit must be greater than zero."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why zero is prohibited? For example we can copy configuration using copying constructor and reset limit after it. With the current restriction we can't do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed zero restriction. Added support for sesOutboundMsgQueueLimit to the copy constructor.
|
||
/** | ||
* Test scenario: | ||
* 1. Thin client performs huge amount of async cache get requests. It does not matter if they belong tounique keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tounique
-> to unique
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
/** | ||
* Test scenario: | ||
* 1. Thin client performs huge amount of async cache get requests. It does not matter if they belong tounique keys. | ||
* 2. Server accepts all of them and prepares responces that are accumulated in the thin client session outbound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responces
-> responses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -138,7 +139,8 @@ | |||
OdbcConfigurationValidationSelfTest.class, | |||
OdbcEscapeSequenceSelfTest.class, | |||
SqlListenerUtilsTest.class, | |||
JavaVersionCommandParserTest.class | |||
JavaVersionCommandParserTest.class, | |||
ClientSessionOutboundQueueLimitTest.class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add ,
to the end of the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
skipClientWrite(grid(0), true); | ||
|
||
Collection<IgniteInternalFuture<byte[]>> futs = ConcurrentHashMap.newKeySet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no concurrency here, why do we need ConcurrentHashMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
/** | ||
* Sets Client session outbound message queue limit. Limits the number of messages waiting to be sent from the | ||
* server side to particular thin client. If the specified limit is exceeded, corresponding thin client connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, ClientConnectorConfiguration
related not only to thin client, but also for jdbc and odbc, so perhaps it's better to use just 'client' in javadoc instead of 'thin client'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.