Re: ORBit-WARNING **: No POA found for operation hcmDebug [-1073747064]




Hi Sebastian,

The code i had for the client/server was similar to the ones
that is already there in the test sub-dir of the ORBit source tree.
I am attaching it to this email and also the scenario i am seeing
in this particular situation. (my specific code)

I have a single threaded client process CLI_PROC which binds to
a 'stale' server IOR when it comes up (SERV_PROC),
The IOR is stale because it has been written by a server process SERV_PROC 
which has died since then.

The way interaction between these two goes is:

CLI_PROC -> binds to stale IOR -> SERV_PROC has come back up again
with a new IOR -> CLI_PROC makes an ORB call to SERV_PROCs object
using the stale IOR -> CLI_PROC gets back CORBA_SYSTEM_EXCEPTION ->
CLI_PROC binds to the new IOR written by SERV_PROC -> next call
succeeds.

The above explained scenario does not go through. when
CLI_PROC makes the ORB call for the first time (with the stale IOR),
though it is supposed to get system exception, it does not. It just
HANGS after spewing out the message
ORBit-WARNING **: No POA found for operation hcmDebug [-1073747064]
on the console. which i believe is coming from the SERV_PROC.

I have tried to debug this, and found that the when the CLI_PROC
makes the initial request, writev goes through w/o any SIGPIPE which
should have been logically the case. Because writev goes thru,
SERV_PROC receives this request, tries to process this request and
fails at the function :

ORBit_POA_find_POA_for_object_key in src/orb/orbit_poa.c

at the line:

if(memcmp(poa->rand_data, key->_buffer + sizeof(CORBA_unsigned_long), 
ORBIT_RAND_KEY_LEN)) {


because it has not such object_id in its ACTIVE_OBJECT_MAP.

I have tried to reproduce this using the echo example but couldnt.
Maybe this is some timing related issue.

CLIENT CODE SNIPPET:
++++++++++++++++++++

IDL SNIPPET:

module hcm {
  struct Debug                          /* debug */
  {
    unsigned long len;                  /* length */
    char buf[512];                      /* buffer */
  };


  ....................
....................
  interface HcmDebugObject
  {
    Debug hcmDebug (in Debug msg);
    CalibrateStatus hcmCalibrateReq ();
    CalibrateStatus hcmCalibrateAbort ();
    CalibrateStatus hcmCalibrateStatus ();
    Result hcmCalibrateConfig (in CalibrateReq req);
  };

  ::::::::::::::::::
  :::::::::::::::::::::
}


CLI_PROC BINDING:
++++++++++++++++
void _bind_hcm(int argc, char *argv[])
{
  FILE        *fp, *fp2;
  char        buffer[MAX_BUF_SIZE];

  /* initialize the exception object */
  CORBA_exception_init(&ev);

  if (orb != NULL) {
      CORBA_Object_release((CORBA_Object)orb, &ev);
  }
  /* initialize the ORB */
  orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", &ev);

   /* connect to the hcm (wave) object server */
  fp = fopen ("/tmp/WAVE.IOR","r");
  if (fp == NULL)
     return;

  fp2 = fopen ("/tmp/DBGBKP.IOR", "a");
  fputs("Opening the dbg ior file\n", fp2);

  fgets (buffer, MAX_BUF_SIZE, fp);
  fclose (fp);
  fic_client = CORBA_ORB_string_to_object(orb, buffer, &ev);
  if (!fic_client)
     Print ("cannot bind to wave IOR\n");

  /* connect to the hcm (switch) object server*/
  fp = fopen ("/tmp/SWITCH.IOR","r");
  if (fp != NULL)
  {
    fgets (buffer, MAX_BUF_SIZE, fp);
    fclose (fp);
    smx_client = CORBA_ORB_string_to_object(orb, buffer, &ev);
    if (!smx_client)
      Print ("cannot bind to switch IOR \n");
  }
  /* connect to the hcm (debug) object server*/
  fp = fopen ("/tmp/HCMDBG.IOR","r");
  if (fp != NULL)
  {
    fgets (buffer, MAX_BUF_SIZE, fp);
    fclose (fp);

    if (dbg_client) {
        CORBA_exception_init (&ev);
        CORBA_Object_release(dbg_client, &ev);
        dbg_client = NULL;
    }
    dbg_client = CORBA_ORB_string_to_object(orb, buffer, &ev);
    if (!dbg_client)
      Print ("cannot bind to dbg IOR \n");
  }
  return;
}

++++++++++++++++++++++
CORBA CALL TO SERV_PROC


result_t hcm_debug_handler ()
{
  FILE *fp;


  if (check_validity_hcmcorba_clients (DBG) == FAILURE)
    return (FAILURE);


  rsp = hcm_HcmDebugObject_hcmDebug (dbg_client, &cmd, &ev);
  if (ev._major != CORBA_NO_EXCEPTION)
  {
    if (rebind_hcm_validate (DBG) == FAILURE) return (FAILURE);
    rsp = hcm_HcmDebugObject_hcmDebug (dbg_client, &cmd, &ev);
    if (check_corba_exception(ev) == FAILURE) return (FAILURE);
  }
  return (SUCCESS);
}


=====================

SERV_PROC is multi-threaded, one of the threads serves
the CLI_PROC, which is hcm_cli_main:
public result_t hcm_cli_main (object_t args)
{
  result_t result;

  /* cli initialization */
  result = hcm_cli_init (args);
  sem_post (&hcm->init_done);
  if (result < SUCCESS)
  {
    hcm->exit_flag = TRUE;
    return (FAILURE);
  }
  hcm_syslog (TRACE_HCM, SL_NOTIFICATION, NULL, "HCM_CLI", "CLI interface 
up");

  /* orbit main loop */
  CORBA_ORB_run (hcm_cli.orb, hcm_cli.ev);

  return (SUCCESS);
}

public result_t hcm_cli_init (object_t args)
{
  CORBA_char *ior;
  FILE *fp;
  int num_args = 1;

  hcm_func_trace ();

  /* reduce cli thread priority */
  if (setpriority (PRIO_PROCESS, 0, THR_PRIORITY_LOW) == FAILURE)
  {
    hcm_syslog (TRACE_CLI, SL_CRITICAL, NULL, "SET_PRIO",
      "cannot set cli thread priority\n");
    return (FAILURE);
  }
  hcm_cli.ev = g_new0 (CORBA_Environment, 1);
  CORBA_exception_init (hcm_cli.ev);

  /* initialize orbit */
  hcm_cli.orb = CORBA_ORB_init (&num_args, (char**)&args, "orbit-local-orb",
    hcm_cli.ev);
  CORBA_exception_init (hcm_cli.ev);
  hcm_cli.poa = (PortableServer_POA)
  CORBA_ORB_resolve_initial_references (hcm_cli.orb, "RootPOA", hcm_cli.ev);
  pm = PortableServer_POA__get_the_POAManager (hcm_cli.poa, hcm_cli.ev);
  PortableServer_POAManager_activate (pm, hcm_cli.ev);

  /* instantiate connection manager object */
  hcm_cli.oxm = impl_hcm_PhotonicSwitchObject__create (hcm_cli.poa, 
hcm_cli.ev);  ior = CORBA_ORB_object_to_string (hcm_cli.orb, hcm_cli.oxm, 
hcm_cli.ev);
  fp = fopen ("/tmp/SWITCH.IOR", "w");
  if (fp == NULL)
  {
    hcm_syslog (TRACE_CLI, SL_CRITICAL, NULL, "CLI_CREATE",
      "cannot write to /tmp/SWITCH.IOR\n");
    return (FAILURE);
  }
  else
  {
    fprintf (fp, "%s", ior);
    fclose (fp);
}
  /* instantiate wave interface object */
  hcm_cli.wgm = impl_hcm_WaveInterfaceObject__create (hcm_cli.poa, 
hcm_cli.ev);
  ior = CORBA_ORB_object_to_string (hcm_cli.orb, hcm_cli.wgm, hcm_cli.ev);
  fp = fopen ("/tmp/WAVE.IOR", "w");
  if (fp == NULL)
  {
    hcm_syslog (TRACE_CLI, SL_CRITICAL, NULL, "CLI_CREATE",
      "cannot write to /tmp/WAVE.IOR\n");
    return (FAILURE);
  }
  else
  {
    fprintf (fp, "%s", ior);
    fclose (fp);
  }
  /* instantiate connection manager object */
  hcm_cli.dbg = impl_hcm_HcmDebugObject__create (hcm_cli.poa, hcm_cli.ev);
  ior = CORBA_ORB_object_to_string (hcm_cli.orb, hcm_cli.dbg, hcm_cli.ev);
  fp = fopen ("/tmp/HCMDBG.IOR", "w");
  if (fp == NULL)
  {
    hcm_syslog (TRACE_CLI, SL_CRITICAL, NULL, "CLI_CREATE",
      "cannot write to /tmp/HCMDBG.IOR\n");
    return (FAILURE);
  }
  else
  {
    fprintf (fp, "%s", ior);
    fclose (fp);
  }
  /*
  pm = PortableServer_POA__get_the_POAManager (hcm_cli.poa, hcm_cli.ev);
  PortableServer_POAManager_activate (pm, hcm_cli.ev);
  */

  /* initialize cli cond and mutex */
  pthread_cond_init (&hcm_cli.cond, NULL);
  pthread_mutex_init (&hcm_cli.mutex, NULL);

  /* initialize working instances */
  hcm_cli.tx_mbuf = hcm_ipc_alloc (HCM_MAX_IPC_MSG_LEN);
  if (hcm_cli.tx_mbuf == NULL)
    return (FAILURE);

  /* initialize calibration values */
  hcm_cal_init ();
  return (SUCCESS);
}



The _create function is the same function that gets generated
by the skel-impl switch to the idl compiler.

_create function:
+================
static hcm_HcmDebugObject
impl_hcm_HcmDebugObject__create(PortableServer_POA poa,
                                CORBA_Environment * ev)
{
   hcm_HcmDebugObject retval;
   impl_POA_hcm_HcmDebugObject *newservant;
   PortableServer_ObjectId *objid;

   newservant = g_new0(impl_POA_hcm_HcmDebugObject, 1);
   newservant->servant.vepv = &impl_hcm_HcmDebugObject_vepv;
   newservant->poa = poa;
   POA_hcm_HcmDebugObject__init((PortableServer_Servant) newservant, ev);
   objid = PortableServer_POA_activate_object(poa, newservant, ev);
   CORBA_free(objid);
   retval = PortableServer_POA_servant_to_reference(poa, newservant, ev);

   return retval;
}
=================================

I have the same prob, whether i use "orbit-local-orb" or
"orbit-local-mt-orb"

Please let me know if you need any more info...I have seen the
same problem way back in ORBit-0.5.2 also and posted it on this
mailing list, never got back any reply...

Any help is greatly appreciated.


Thanks
Rajesh




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]