[ 
https://issues.apache.org/jira/browse/TRAFODION-2646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16060184#comment-16060184
 ] 

ASF GitHub Bot commented on TRAFODION-2646:
-------------------------------------------

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



> mxosrvr connection state doesn't change to AVAILABLE after the timeout if no 
> client connect to it 
> --------------------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2646
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2646
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: connectivity-mxosrvr
>            Reporter: Weiqing Xu
>            Assignee: Weiqing Xu
>             Fix For: 2.2-incubating
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to