Bug 752355 - RFE: Evaluate MAX_*_LOG values
Summary: RFE: Evaluate MAX_*_LOG values
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor
Version: 1.0
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: 2.1.1
: ---
Assignee: Matthew Farrellee
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-09 10:01 UTC by Tomas Rusnak
Modified: 2011-12-08 19:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-22 13:49:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Condor 2472 0 None None None Never
Red Hat Bugzilla 569561 0 low CLOSED errors in >=2GB log file handling 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 752823 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 755765 0 medium CLOSED RFE: Gracefully handle MAX_..._LOG configuration errors 2021-02-22 00:41:40 UTC

Internal Links: 569561 752823

Description Tomas Rusnak 2011-11-09 10:01:38 UTC
Description of problem:
Setting log size in condor configuration to evaluated value, or to bad value cause daemon abort.

Version-Release number of selected component (if applicable):
condor-7.6.5-0.6

How reproducible:
100%


Steps to Reproduce:
1. set in config MAX_SCHEDD_LOG=a or MAX_SCHEDD_LOG=1024*1024
2. service condor restart
3. ps ax | grep condor -> no schedd is running
4. check MasterLog
  
Actual results:
The value other then simple number is ignored. Daemon is aborted without any details in logs.


Expected results:
All daemons needs to be checked for this error. The MAX_*_LOG value needs to be evaluated. In case of bad value the error message could be logged, at least in MasterLog.

Comment 1 Matthew Farrellee 2011-11-09 13:13:19 UTC
This is because there is no param_long_long() or param_off_t(). Integer types in ClassAds are 32-bit.

src/condor_utils/dprintf_config.cpp

            if (debug_level == 0) {
               (void)sprintf(pname, "MAX_%s_LOG", subsys);
            } else {
               (void)sprintf(pname, "MAX_%s_%s_LOG", subsys,
                          _condor_DebugFlagNames[debug_level-1]+2);
            }
                
                off_t maxlog = 0;
            pval = param(pname);
            if (pval != NULL) {
                    // because there is nothing like param_long_long() or param_off_t()
                    bool r = lex_cast(pval, maxlog);
                    if (!r || (maxlog < 0)) {
                        EXCEPT("Invalid config: %s = %s", pname, pval);
                    }
                    MaxLog[debug_level] = maxlog;
               free(pval);
            } else {
               MaxLog[debug_level] = 1024*1024;
            }


This may have to be WONTFIX.

Comment 2 Matthew Farrellee 2011-11-09 13:16:07 UTC
Note - there is an inconsistency here, some MAX_..._LOG config params are evaluated (those using param_integer),

$ git grep MAX_ | grep _LOG | grep param | grep \.cpp
src/condor_schedd.V6/schedd.cpp:	int max_saved_rotations = param_integer( "MAX_JOB_QUEUE_LOG_ROTATIONS", DEFAULT_MAX_JOB_QUEUE_LOG_ROTATIONS );
src/condor_schedd.V6/schedd_main.cpp:	int max_historical_logs = param_integer( "MAX_JOB_QUEUE_LOG_ROTATIONS", DEFAULT_MAX_JOB_QUEUE_LOG_ROTATIONS );
src/condor_utils/classadHistory.cpp:    MaxHistoryFileSize = param_integer("MAX_HISTORY_LOG", 
src/condor_utils/file_xml.cpp:	xml_log_limit = param_integer("MAX_XML_LOG", FILESIZELIMT);
src/condor_utils/proc_family_proxy.cpp:	char *procd_log_size = param("MAX_PROCD_LOG");
src/condor_utils/read_user_log.cpp:	int max_rotations = param_integer( "EVENT_LOG_MAX_ROTATIONS", 1, 0 );
src/condor_utils/write_user_log.cpp:	m_global_max_rotations = param_integer( "EVENT_LOG_MAX_ROTATIONS", 1, 0 );
src/condor_utils/write_user_log.cpp:	m_global_max_filesize = param_integer( "EVENT_LOG_MAX_SIZE", -1 );
src/condor_utils/write_user_log.cpp:		m_global_max_filesize = param_integer( "MAX_EVENT_LOG", 1000000, 0 );

Comment 3 Erik Erlandson 2011-11-09 15:01:33 UTC
(In reply to comment #0)

> Steps to Reproduce:
> 1. set in config MAX_SCHEDD_LOG=a or MAX_SCHEDD_LOG=1024*1024
> 2. service condor restart
> 3. ps ax | grep condor -> no schedd is running
> 4. check MasterLog
> 
> Actual results:
> The value other then simple number is ignored. Daemon is aborted without any
> details in logs.


As Matt described, values like "1024*1024" which require expression evaluation cannot be addressed currently for MAX_<SUBSYS>_LOG, because the classad library does not currently support 64-bit integer values.

Currently, this forces a choice between supporting 64-bit max-log values and supporting generalized expression eval.   Support for 64-bit max log values was considered more important to users.

There is an upstream RFE for supporting 64-bit integer values in classads:
https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=2472

Until that RFE is addressed, I agree that this should be "wontfix" (or maybe "deferred"?)

Comment 4 Matthew Farrellee 2011-11-09 20:00:38 UTC
Deferred until https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=2472, desire for MAX_..._LOG evaluation recorded upstream.


Note You need to log in before you can comment on or make changes to this bug.