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

[DRAFT DO NOT REVIEW] Wip limit max threads to server #7865

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

albertogpz
Copy link
Contributor

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Works for puts, gets and transactions and
them also within functions.

This solution allows to limit the number of threads
handling client requests in a server waiting for
a response from a given server.

For example, if we configure the system to allow
at max 1/2 of the available threads to handle client requests
busy towards a given server, supposing we have a
4 servers system with MAX_THREADS=8, if at a given point
in time server1 has 4 threads busy waiting to get a
response from server2 and another request comes to server1
that would require to communicate with server2,
the request will be rejected.

This feature could be used in situations when a server is not responding
or is responding slowly in order to limit the number of server
threads (in the rest of servers) to handle client requests that are
busy waiting for an answer from the problematic server.
This way, even if a server is not responding or is being very
slow, there will always be some threads available to handle
client requests in the healthy servers.
As a result, a non-responding server would not eventually
provoke a 100% traffic loss.

In order to implement this feature, a new observer type
has been created (SendReceiveMessageObserver).
Calls to this observer have been added before
a put, get or transaction needs to go to another server
(before any change has been made locally) and
after the response has been received.

With a particular implementation of this observer
(see GenericDunitTest.MySendReceiveMessageObserver)
that keeps track of the number of threads waiting for
an answer to each servers, operations may be rejected
if the limit has been surpassed.

In GenericDUnitTest that observer is set in the
servers and the functionality can be tested
manually by looking at the logs.

Some refactorings and renamings
@albertogpz albertogpz force-pushed the wip/handle_max_threads_to_server branch 2 times, most recently from ec4bbb7 to 5087bb8 Compare September 29, 2022 15:01
…d add function to sanctioned data serializables
@albertogpz albertogpz force-pushed the wip/handle_max_threads_to_server branch from 5087bb8 to a1ee7c3 Compare September 29, 2022 15:11
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.

1 participant