-
Notifications
You must be signed in to change notification settings - Fork 55
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
GEODE-2891 connect-timeout violation in C++ Native Client #105
Conversation
Change time measure unit for handshake from seconds to milliseconds
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.
Please rebase your changes on develop rather than merge.
Do not include comments with ticket numbers.
Do not include comments with your name or initials.
Do not leave sources commented out, delete or delete not.
Please follow the C++ style of the community.
I am concerned with the approach of trying to define a pseudo message for handshaking to get a different timeout unit. This may bite us in the future when added new messages to the protocol.
There are a few tickets in flight, or soon to be in flight, that address this problem.
https://issues.apache.org/jira/browse/GEODE-3136
https://issues.apache.org/jira/browse/GEODE-3137
I have begun some experiments with GEODE-3136 and should start committing to it in a few days. All API exposed timeouts will be based on std::chrono::duration so you can clearly see what unit of time your time is and the code behind that API doesn't have to guess. GEODE-3137 will address on use cases internally that aren't addressed when updating the public API. Any configuration files that specify timeout will be updated to take a duration string as well in the format of "1234s", "1234ms", etc.
@@ -318,7 +318,9 @@ bool TcrConnection::InitTcrConnection( | |||
LOGFINE("Attempting handshake with endpoint %s for %s%s connection", endpoint, | |||
isClientNotification ? (isSecondary ? "secondary " : "primary ") : "", | |||
isClientNotification ? "subscription" : "client"); | |||
ConnErrType error = sendData(data, msgLengh, connectTimeout, false); | |||
// GT GEODE-2891 |
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.
Do not include comments with your name or the ticket number.
@@ -318,7 +318,9 @@ bool TcrConnection::InitTcrConnection( | |||
LOGFINE("Attempting handshake with endpoint %s for %s%s connection", endpoint, | |||
isClientNotification ? (isSecondary ? "secondary " : "primary ") : "", | |||
isClientNotification ? "subscription" : "client"); | |||
ConnErrType error = sendData(data, msgLengh, connectTimeout, false); | |||
// GT GEODE-2891 | |||
//ConnErrType error = sendData( data, msgLengh, connectTimeout, false ); |
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.
Do not leave commented out sources, this is what revision control is for.
sendTimeoutSec = sendTimeoutSec * 1000; | ||
isPublicApiTimeout = true; | ||
LOGDEBUG("sendData2 %d ", sendTimeoutSec); | ||
} |
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.
Formatting does not conform to Google C++ Style Guide.
@@ -171,7 +173,8 @@ class CPPCACHE_EXPORT TcrMessage { | |||
GET_DURABLE_CQS_DATA_ERROR = 106, | |||
GET_ALL_WITH_CALLBACK = 107, | |||
PUT_ALL_WITH_CALLBACK = 108, | |||
REMOVE_ALL = 109 | |||
REMOVE_ALL = 109, | |||
HANDSHAKE = 110 |
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 numbers correspond to protocol message numbers on the server. We can just add one here and expect it not cause issues later.
@@ -44,6 +44,8 @@ | |||
#include <map> | |||
#include <vector> | |||
|
|||
// |
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.
Clean this up.
I suggest to fix the issue by defining handshake pseudo message within the range probably defined for such pseudo messages by original design i.e.:
typedef enum {
/* Server couldn't read message; handle it like a server side
exception that needs retries */
HANDSHAKE = -3
NOT_PUBLIC_API_WITH_TIMEOUT = -2,
WDYT?
Thanks,
Dr. Gregory Turovets
"…We're all mad here. I'm mad. You're mad."
"How do you know I'm mad?" said Alice.
"You must be," said the Cat, "or you wouldn't have come here."
Alice's Adventures in Wonderland by Lewis Carroll<http://www.livelib.ru/author/157108>.
From: Jacob Barrett [mailto:notifications@github.com]
Sent: Sunday, July 02, 2017 17:46
To: apache/geode-native <geode-native@noreply.github.com>
Cc: Gregory Turovets <gregory.turovets@amdocs.com>; Author <author@noreply.github.com>
Subject: Re: [apache/geode-native] GEODE-2891 connect-timeout violation in C++ Native Client (#105)
@pivotal-jbarrett requested changes on this pull request.
Please rebase your changes on develop rather than merge.
Do not include comments with ticket numbers.
Do not include comments with your name or initials.
Do not leave sources commented out, delete or delete not.
Please follow the C++ style of the community.
I am concerned with the approach of trying to define a pseudo message for handshaking to get a different timeout unit. This may bite us in the future when added new messages to the protocol.
There are a few tickets in flight, or soon to be in flight, that address this problem.
https://issues.apache.org/jira/browse/GEODE-3136
https://issues.apache.org/jira/browse/GEODE-3137
I have begun some experiments with GEODE-3136 and should start committing to it in a few days. All API exposed timeouts will be based on std::chrono::duration so you can clearly see what unit of time your time is and the code behind that API doesn't have to guess. GEODE-3137 will address on use cases internally that aren't addressed when updating the public API. Any configuration files that specify timeout will be updated to take a duration string as well in the format of "1234s", "1234ms", etc.
________________________________
In src/cppcache/src/TcrConnection.cpp<#105 (comment)>:
@@ -318,7 +318,9 @@ bool TcrConnection::InitTcrConnection(
LOGFINE("Attempting handshake with endpoint %s for %s%s connection", endpoint,
isClientNotification ? (isSecondary ? "secondary " : "primary ") : "",
isClientNotification ? "subscription" : "client");
- ConnErrType error = sendData(data, msgLengh, connectTimeout, false);
+ // GT GEODE-2891
Do not include comments with your name or the ticket number.
________________________________
In src/cppcache/src/TcrConnection.cpp<#105 (comment)>:
@@ -318,7 +318,9 @@ bool TcrConnection::InitTcrConnection(
LOGFINE("Attempting handshake with endpoint %s for %s%s connection", endpoint,
isClientNotification ? (isSecondary ? "secondary " : "primary ") : "",
isClientNotification ? "subscription" : "client");
- ConnErrType error = sendData(data, msgLengh, connectTimeout, false);
+ // GT GEODE-2891
+ //ConnErrType error = sendData( data, msgLengh, connectTimeout, false );
Do not leave commented out sources, this is what revision control is for.
________________________________
In src/cppcache/src/TcrConnection.cpp<#105 (comment)>:
- // then app has set timeout in millis, change it to microSeconds
- sendTimeoutSec = sendTimeoutSec * 1000;
- isPublicApiTimeout = true;
- LOGDEBUG("sendData2 %d ", sendTimeoutSec);
- } else {
- sendTimeoutSec = sendTimeoutSec * 1000;
- }
+ notPublicApiWithTimeout == TcrMessage::EXECUTE_REGION_FUNCTION_SINGLE_HOP ||
+ // GT GEODE-2891
+ notPublicApiWithTimeout == TcrMessage::HANDSHAKE)
+ {
+ // then app has set timeout in millis, change it to microSeconds
+ sendTimeoutSec = sendTimeoutSec * 1000;
+ isPublicApiTimeout = true;
+ LOGDEBUG("sendData2 %d ", sendTimeoutSec);
+ }
Formatting does not conform to Google C++ Style Guide<https://google.github.io/styleguide/cppguide.html>.
________________________________
In src/cppcache/src/TcrMessage.hpp<#105 (comment)>:
@@ -171,7 +173,8 @@ class CPPCACHE_EXPORT TcrMessage {
GET_DURABLE_CQS_DATA_ERROR = 106,
GET_ALL_WITH_CALLBACK = 107,
PUT_ALL_WITH_CALLBACK = 108,
- REMOVE_ALL = 109
+ REMOVE_ALL = 109,
+ HANDSHAKE = 110
These numbers correspond to protocol message numbers on the server. We can just add one here and expect it not cause issues later.
________________________________
In src/cppcache/src/TcrMessage.hpp<#105 (comment)>:
@@ -44,6 +44,8 @@
#include <map>
#include <vector>
+//
Clean this up.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#105 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AbZcfm-Wvg_K8tzwTd2ACFihvkB1aQLaks5sJ60jgaJpZM4OLjA1>.
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
|
I think that would certainly work better but I think ultimately the fix is to remove the ambiguity between the C++ API and the Server API by strongly typing the duration values as addressed in the mentioned tickets. All duration values can be cast to the internal API supported unit without any ambiguity. After which there is no need to create this pseudo message to change the unit of the ambiguous int value. |
@gregt5259 please close this pull request since you opened #106. |
Closed by Ernie Burghardt request as duplicated #106 |
The fix enables to interpret the time measure unit in handshake as milliseconds rather than seconds.