trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] trafodion pull request #1728: [TRAFODION-2626] Make logs directory location ...
Date Wed, 17 Oct 2018 23:43:10 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1728#discussion_r226129024
  
    --- Diff: core/sql/sqludr/SqlUdrPredefLogReader.cpp ---
    @@ -530,37 +530,28 @@ void ReadCppEventsUDFInterface::processData(UDRInvocationInfo &info,
       {
         char* logrootdir = NULL;
         char* confrootdir = NULL;
    +
    +    logrootdir = getenv("TRAF_LOG");
    +    if (strlen(logrootdir) > 1000)
    +	throw UDRException(38001, "TRAF_HOME is longer than 1000 characters");
    +    std::string logDirName(logrootdir);
    +
         switch (logLocationIndex) 
         {
    -    case 0: // sqroot, for all logs other than dcs
    -      logrootdir = getenv("TRAF_HOME");
    -      if (strlen(logrootdir) > 1000)
    -	throw UDRException(38001, "TRAF_HOME is longer than 1000 characters");
    +    case 0: // no sub-directory
           break ;
         case 1:
    -      logrootdir = getenv("DCS_INSTALL_DIR");
    -      if (!logrootdir)
    -	throw UDRException(38001, "DCS_INSTALL_DIR not set");
    -      else if (strlen(logrootdir) > 1000)
    -	throw UDRException(38001, "DCS_INSTALL_DIR is longer than 1000 characters");
    +      logDirName += "/dcs";
           break ;
         case 2:
    -      logrootdir = getenv("REST_INSTALL_DIR");
    -      if (!logrootdir)
    -	throw UDRException(38001, "REST_INSTALL_DIR not set");
    -      else if (strlen(logrootdir) > 1000)
    -	throw UDRException(38001, "REST_INSTALL_DIR is longer than 1000 characters");
    -      break ;
    +      logDirName += "/rest";
    --- End diff --
    
    You need a "break;" statement after this one, otherwise you fall through to the default
case and raise an exception. This is probably why test udr/TEST002 failed in the regression
test run.


---

Mime
View raw message