You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by xwq <gi...@git.apache.org> on 2017/06/16 10:34:58 UTC
[GitHub] incubator-trafodion pull request #1122: [TRAFODION-2646]mxosrvr change to AV...
GitHub user xwq opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1122
[TRAFODION-2646]mxosrvr change to AVAILABLE after timeout if no clien…
…t connect
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/xwq/incubator-trafodion connecting_timeout
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1122.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1122
----
commit cce0e5dd95ff5ab0380e58c12d0d546402481b01
Author: Weiqing Xu <we...@esgyn.cn>
Date: 2017-06-16T10:38:55Z
[TRAFODION-2646]mxosrvr change to AVAILABLE after timeout if no client connect
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1122: [TRAFODION-2646]mxosrvr change to AV...
Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1122#discussion_r123890678
--- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp ---
@@ -1680,47 +1683,49 @@ void __cdecl SRVR::ASTimerExpired(CEE_tag_def timer_tag)
if( tkn == NULL )
goto HandleNoTokens;
- if( stricmp(tkn, "CONNECTING") && stricmp(tkn, "CONNECT_FAILED") && stricmp(tkn, "CONNECT_REJECTED") ) // Not in CONNECTING state
- {
- timeout = JULIANTIMESTAMP();
- prevDialogueId = 0;
- }
- else
- {
- strcpy( state, tkn );
+ enum {REG_CONNECTING, REG_CONNECT_FAILED, REG_CONNECT_REJECTED, REG_CONNECT_OTHER} reg_connection_state;
- // Skip second token - Timestamp
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ // use numeric to represent the state since the state will used again,
+ // and we don't want compare the string twice
+ if (stricmp(tkn, "CONNECTING") == 0) {
+ reg_connection_state = REG_CONNECTING;
+ }
+ else if (stricmp(tkn, "CONNECT_FAILED") == 0) {
+ reg_connection_state = REG_CONNECT_FAILED;
+ }
+ else if (stricmp(tkn, "CONNECT_REJECTED") == 0) {
+ reg_connection_state = REG_CONNECT_REJECTED;
+ }
+ else {
+ reg_connection_state = REG_CONNECT_OTHER;
+ prevDialogueId = 0;
+ }
- // Third token is dialogue ID
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ if (reg_connection_state != REG_CONNECT_OTHER) {
+ strcpy(state, tkn);
- currDialogueId = atoi(tkn);
+ // Skip second token - Timestamp
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
- if( prevDialogueId == 0 || prevDialogueId != currDialogueId )
- {
- prevDialogueId = currDialogueId;
- timeout = JULIANTIMESTAMP();
- }
+ // Third token is dialogue ID
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
+
+ currDialogueId = atoi(tkn);
+ prevDialogueId = currDialogueId;
+
--- End diff --
Thanks for confirming. +1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1122: [TRAFODION-2646]mxosrvr change to AV...
Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1122#discussion_r123726122
--- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp ---
@@ -1680,47 +1683,49 @@ void __cdecl SRVR::ASTimerExpired(CEE_tag_def timer_tag)
if( tkn == NULL )
goto HandleNoTokens;
- if( stricmp(tkn, "CONNECTING") && stricmp(tkn, "CONNECT_FAILED") && stricmp(tkn, "CONNECT_REJECTED") ) // Not in CONNECTING state
- {
- timeout = JULIANTIMESTAMP();
- prevDialogueId = 0;
- }
- else
- {
- strcpy( state, tkn );
+ enum {REG_CONNECTING, REG_CONNECT_FAILED, REG_CONNECT_REJECTED, REG_CONNECT_OTHER} reg_connection_state;
- // Skip second token - Timestamp
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ // use numeric to represent the state since the state will used again,
+ // and we don't want compare the string twice
+ if (stricmp(tkn, "CONNECTING") == 0) {
+ reg_connection_state = REG_CONNECTING;
+ }
+ else if (stricmp(tkn, "CONNECT_FAILED") == 0) {
+ reg_connection_state = REG_CONNECT_FAILED;
+ }
+ else if (stricmp(tkn, "CONNECT_REJECTED") == 0) {
+ reg_connection_state = REG_CONNECT_REJECTED;
+ }
+ else {
+ reg_connection_state = REG_CONNECT_OTHER;
+ prevDialogueId = 0;
+ }
- // Third token is dialogue ID
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ if (reg_connection_state != REG_CONNECT_OTHER) {
+ strcpy(state, tkn);
- currDialogueId = atoi(tkn);
+ // Skip second token - Timestamp
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
- if( prevDialogueId == 0 || prevDialogueId != currDialogueId )
- {
- prevDialogueId = currDialogueId;
- timeout = JULIANTIMESTAMP();
- }
+ // Third token is dialogue ID
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
+
+ currDialogueId = atoi(tkn);
+ prevDialogueId = currDialogueId;
+
--- End diff --
I have run the all phx test. It haven't reproduced. And I also keep the logic as the old. So I think it's OK.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1122: [TRAFODION-2646]mxosrvr change to AV...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-trafodion/pull/1122
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1122: [TRAFODION-2646]mxosrvr change to AV...
Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1122#discussion_r123644367
--- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp ---
@@ -1680,47 +1683,49 @@ void __cdecl SRVR::ASTimerExpired(CEE_tag_def timer_tag)
if( tkn == NULL )
goto HandleNoTokens;
- if( stricmp(tkn, "CONNECTING") && stricmp(tkn, "CONNECT_FAILED") && stricmp(tkn, "CONNECT_REJECTED") ) // Not in CONNECTING state
- {
- timeout = JULIANTIMESTAMP();
- prevDialogueId = 0;
- }
- else
- {
- strcpy( state, tkn );
+ enum {REG_CONNECTING, REG_CONNECT_FAILED, REG_CONNECT_REJECTED, REG_CONNECT_OTHER} reg_connection_state;
- // Skip second token - Timestamp
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ // use numeric to represent the state since the state will used again,
+ // and we don't want compare the string twice
+ if (stricmp(tkn, "CONNECTING") == 0) {
+ reg_connection_state = REG_CONNECTING;
+ }
+ else if (stricmp(tkn, "CONNECT_FAILED") == 0) {
+ reg_connection_state = REG_CONNECT_FAILED;
+ }
+ else if (stricmp(tkn, "CONNECT_REJECTED") == 0) {
+ reg_connection_state = REG_CONNECT_REJECTED;
+ }
+ else {
+ reg_connection_state = REG_CONNECT_OTHER;
+ prevDialogueId = 0;
+ }
- // Third token is dialogue ID
- tkn = strtok(NULL, ":");
- if( tkn == NULL )
- goto HandleNoTokens;
+ if (reg_connection_state != REG_CONNECT_OTHER) {
+ strcpy(state, tkn);
- currDialogueId = atoi(tkn);
+ // Skip second token - Timestamp
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
- if( prevDialogueId == 0 || prevDialogueId != currDialogueId )
- {
- prevDialogueId = currDialogueId;
- timeout = JULIANTIMESTAMP();
- }
+ // Third token is dialogue ID
+ tkn = strtok(NULL, ":");
+ if (tkn == NULL)
+ goto HandleNoTokens;
+
+ currDialogueId = atoi(tkn);
+ prevDialogueId = currDialogueId;
+
--- End diff --
Sorry for the delay Weiqing.
We don't seem to be using prevDialogueId now ? Earlier this was introduced for problems seen in doing multiple connects/disconnects via endurance test. If similar tests have been run to test this change then please go ahead and merge.
https://issues.apache.org/jira/browse/TRAFODION-156
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---