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

IGNITE-20424 Added client session outbound queue size limit. #10980

Merged
merged 8 commits into from
Oct 13, 2023

Conversation

petrov-mg
Copy link
Contributor

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

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    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.

@petrov-mg petrov-mg force-pushed the IGNITE-20424 branch 3 times, most recently from cc06f04 to 6102e95 Compare October 6, 2023 08:38
}

/** */
GridNioServer<ClientMessage> nioServer() {
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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();

Copy link
Contributor

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

@ivandasch ivandasch left a 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.

* @return {@code this} for chaining.
*/
public ClientConnectorConfiguration setSessionOutboundMessageQueueLimit(int sesOutboundMsgQueueLimit) {
A.ensure(sesOutboundMsgQueueLimit > 0, "Session outbound queue limit must be greater than zero.");
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tounique -> to unique

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responces -> responses

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@petrov-mg petrov-mg merged commit 0f0e465 into apache:master Oct 13, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants