Uploaded image for project: 'Open Development'
  1. Open Development
  2. OPEN-318

LLSecApi initialization

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Unset
    • Resolution: Unresolved
    • Component/s: None
    • Labels:
      None

      Description

      This came up in a discussion between Nat Linden and me about how the viewer handles exceptions and how they can propagate out of coroutines.

      Nat asked me to file this so someone with better knowledge about the topic can chime in and propose a change (if needed at all).

      The function in question is initializeSecHandler (llsecapi.cpp) and there's this code we're both had not been sure how it should behave:

      std::map<std::string, LLPointer<LLSecAPIHandler> >::const_iterator itr;
      for(itr = gHandlerMap.begin(); itr != gHandlerMap.end(); ++itr)
      {
      	LLPointer<LLSecAPIHandler> handler = (*itr).second;
      	try 
      	{
      		handler->init();
      	}
      	catch (LLProtectedDataException e)
      	{
      		exception_msg = e.getMessage();
      	}
      }
      if (!exception_msg.empty())  // an exception was thrown.
      {
      	throw LLProtectedDataException(exception_msg.c_str());
      }
      

      There is potentially (more of this later) N instances of LLSecAPIHandler that are getting initialized. If there would be N amount of exceptions happening, the final exception after the loop would only report the last failure (exception_msg is always overwritten in case of an exception).

      This lead to a few questions:

      • Shall the whole loop be aborted on the first exception and that error be reported?
      • Or shall the errors be concactenated?
      • Or, as there only ever seems to be a BASIC_SECHANDLER handler, maybe the whole loop should be removed and there is only need for one handler rather than a whole map?

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nicky.dasmijn Nicky Dasmijn
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                PagerDuty