Summary: log: Incorrect syslog if fail to close files when closing log stream 
[#1129]
Review request for Trac Ticket(s): #1129
Peer Reviewer(s): mathi.naic...@oracle.com
Pull request to: -
Affected branch(es): 4.4, 4.5 default
Development branch: <<IF ANY GIVE THE REPO URL>>

--------------------------------
Impacted area       Impact y/n
--------------------------------
 Docs                    n
 Build system            n
 RPM/packaging           n
 Configuration files     n
 Startup scripts         n
 SAF services            y
 OpenSAF services        n
 Core libraries          n
 Samples                 n
 Tests                   n
 Other                   n


Comments (indicate scope for each "y" above):
---------------------------------------------
 <<EXPLAIN/COMMENT THE PATCH SERIES HERE>>

changeset 4ce41abbbc11150fc0a521e91cbc63b9e428da38
Author: Lennart Lund <lennart.l...@ericsson.com>
Date:   Wed, 03 Dec 2014 10:00:14 +0100

        log: Incorrect syslog if fail to close files when closing log stream 
[#1129]

        Add parameter to fileclose_h() to save errno and handle error return 
when
        timeout or busy.


Complete diffstat:
------------------
 osaf/services/saf/logsv/lgs/lgs_filehdl.c |  14 +++++++++++++-
 osaf/services/saf/logsv/lgs/lgs_stream.c  |  39 
++++++++++++++++++++++++++-------------
 2 files changed, 39 insertions(+), 14 deletions(-)


Testing Commands:
-----------------
1.
With TIMEOUT case: I added some test code in the function fileclose_hdl(),
make file system hang for n sec at first close. 
Run “ saflogger -a safLgStrCfg=Test “Hello world” ”. 

2.
With BUSY case: in the file lgs_filehdl.c activate test code LLD_DELAY_WRTST.
Run “ saflogger -a safLgStrCfg=Test “xxx” “. 


Testing, Expected Results:
--------------------------
1.
The logs show:
Dec  1 17:24:27.540512 osaflogd [395:lgs_stream.c:0836] >> log_stream_close: 
safLgStrCfg=Test            
Dec  1 17:24:27.540542 osaflogd [395:lgs_stream.c:0109] >> fileclose_h: fd=25   
                  
Dec  1 17:24:27.540645 osaflogd [395:lgs_filehdl.c:0515] >> fileclose_hdl: fd=25
Dec  1 17:24:27.684920 osaflogd [395:lgs_filehdl.c:0540] TR LLDTEST Hang close  
       
Dec  1 17:24:28.043310 osaflogd [395:lgs_file.c:0431] TR Timed out before answer
**Dec  1 17:24:28.043509 osaflogd [395:lgs_stream.c:0127] TR fileclose_h - API 
error LGSF_TIMEOUT      ** Look here **
Dec  1 17:24:28.043869 osaflogd [395:lgs_stream.c:0140] << fileclose_h: rc = -1 
     
Dec  1 17:24:28.044053 osaflogd [395:lgs_stream.c:0859] NO Could not close log 
files: Connection timed out

2.
The logs show:
Dec  1 17:13:06.513095 osaflogd [395:lgs_filehdl.c:0263] >> write_log_record_hdl
Dec  1 17:13:06.513166 osaflogd [395:lgs_filehdl.c:0288] TR LLDTEST xxx Hang 
write     
Dec  1 17:13:07.014196 osaflogd [395:lgs_file.c:0431] TR Timed out before answer
Dec  1 17:13:07.014349 osaflogd [395:lgs_stream.c:1242] TR log_stream_write_h - 
API error LGSF_TIMEOUT             
Dec  1 17:13:07.014410 osaflogd [395:lgs_stream.c:1259] IN write 
'safLgStrCfg=Test_20141201_171306' failed "Timeout"
Dec  1 17:13:07.014458 osaflogd [395:lgs_stream.c:0109] >> fileclose_h: fd=25   
     
**Dec  1 17:13:07.014550 osaflogd [395:lgs_file.c:0362] TR log_file_api - 
LGSF_BUSY     ** Look here **
Dec  1 17:13:07.014597 osaflogd [395:lgs_stream.c:0121] TR fileclose_h - API 
error LGSF_BUSY                       
Dec  1 17:13:07.014642 osaflogd [395:lgs_file.c:0291] >> lgs_fd_list_add: fd = 
25                        
Dec  1 17:13:07.014689 osaflogd [395:lgs_file.c:0308] << lgs_fd_list_add        
                 
Dec  1 17:13:07.014931 osaflogd [395:lgs_stream.c:0140] << fileclose_h: rc = -1 
                              
Dec  1 17:13:07.014986 osaflogd [395:lgs_stream.c:1268] NO fileclose failed 
Device or resource busy


Conditions of Submission:
-------------------------
Ack by reviewers or one week


Arch      Built     Started    Linux distro
-------------------------------------------
mips        n          n
mips64      n          n
x86         n          n
x86_64      n          n
powerpc     n          n
powerpc64   n          n


Reviewer Checklist:
-------------------
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
    that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
    (i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
    Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
    like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
    cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
    too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
    Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
    commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
    of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
    comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
    the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
    for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
    do not contain the patch that updates the Doxygen manual.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to