SourceForge has been redesigned. Learn more.
Close

#79 sfcc cannot reconnect with sfcb if sfcb restarts

Code_Cleanup
fixed
None
1
None
2013-10-02
2013-09-03
rustypeng
No

I tried creating the connection and then release the connection, and then create the connection again. But the second time it fails. Anyone seen this before? Thanks.
Here's the test code.
ce = NewCIMCEnv("SfcbLocal", 0, &status, &msg);
if(ce == NULL)
{
pclient = NULL;
logger.info("local connect failed call to NewCIMCEnv rc = %d , message = [%s]", status, msg) ;
}
else{
logger.info("NewCIMCEnv success rc = %d, message = [%s]", status, msg);
CIMCStatus rc;
pclient = ce->ft->connect(ce, "localhost", NULL, NULL, NULL, NULL, &rc);
logger.info("connect() rc=%d, msg=%s", rc.rc, (rc.msg) ? (char *)rc.msg->hdl : NULL);
}

    if(pclient) CMRelease(pclient);
    if(ce) CMRelease(ce);

    ce = NewCIMCEnv("SfcbLocal", 0, &status, &msg);
    if(ce == NULL)
    {
            pclient = NULL;
            logger.info("local connect failed call to NewCIMCEnv rc = %d , message = [%s]", status, msg) ;
    }
    else{
            logger.info("NewCIMCEnv success rc = %d, message = [%s]", status, msg);
            CIMCStatus rc;
            pclient = ce->ft->connect(ce, "localhost", NULL, NULL, NULL, NULL, &rc);
            logger.info("connect() rc=%d, msg=%s", rc.rc, (rc.msg) ? (char *)rc.msg->hdl : NULL);
    }

The output is
[2013-09-03 03:31:52][info] NewCIMCEnv success rc = 0, message = [(null)]
[2013-09-03 03:31:52][info] connect() rc=0, msg=(null)
[2013-09-03 03:31:52][info] NewCIMCEnv success rc = 0, message = [(null)]
[2013-09-03 03:31:52][info] connect() rc=1, msg=Invalid argument

Discussion

  • Chris Buccella

    Chris Buccella - 2013-09-11

    Ticket moved from /p/sblim/sfcb-tix/71/

    Can't be converted:

    • _priority: 100
    • _category: Function
    • _milestone: backlog
     
  • Chris Buccella

    Chris Buccella - 2013-09-11
    • Component: --> sfcc
    • Group: backlog --> Code_Cleanup
    • Priority: 100 --> 1
     
  • Chris Buccella

    Chris Buccella - 2013-09-13

    Hi Rusty,

    The main problem seems to be that the client library says loaded even after the CMRelease(ce). This is because the release() function allows the client library to do cleanup on the CIMCEnv, but the library does not unload itself. NewCIMCEnv() has a counterpart, ReleaseCIMCEnv(), that does the dlunload.

    However, the release functions between the SfcbLocal and XML backends are not consistent. So the bug here is getting all that working correctly so that ReleaseCIMCEnv() can be called from the client program.

     
    Last edit: Chris Buccella 2013-09-13
  • Chris Buccella

    Chris Buccella - 2013-09-18

    Committed [24972c]

    Programs using SFCC should now call ReleaseCIMCEnv() instead of CMRelease(ce). This will cause the backend library to be unloaded, preventing strangeness if a new CIMCEnv is created.

     

    Related

    Commit: [24972c]


    Last edit: Chris Buccella 2013-09-18
  • Chris Buccella

    Chris Buccella - 2013-09-18

    SFCB git commit [34137e] is the matching cimcClientSfcbLocal.c change

     

    Related

    Commit: [34137e]


    Last edit: Chris Buccella 2013-09-18
  • Chris Buccella

    Chris Buccella - 2013-09-18
    • status: open --> pending
     
  • Chris Buccella

    Chris Buccella - 2013-09-26

    Ticket moved from /p/sblim/bugs/2663/

    Can't be converted:

    • _component: sfcc
    • _milestone: Code_Cleanup
    • _priority: 1
     
  • Dave Heller

    Dave Heller - 2013-10-02
    • Status: pending --> fixed
     

Log in to post a comment.