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 [email protected] or file a JIRA ticket
with INFRA.
---