Refinitiv / Real-Time-SDK

Other
186 stars 129 forks source link

Trace log file not cycling #255

Closed andysCaplin closed 5 months ago

andysCaplin commented 10 months ago

I have enabled logging in a VA consumer example and set the log cycle size to 1000 but the log isn't cycling.

I can see the code for the cycling is in _rsslTraceStartMsg() but when I run under gdb and I set a breakpoint for that routine I never hit it but I do get XML trace files. Maybe _rsslTraceStartMsg() is optimised but then I thought I wouldn't be able to set a breakpoint on it.

Lib version is - ETA PACKAGE eta3.7.2.L1 rrg VERSION eta3.7.2.0 Tue Nov 07 17:09:30 CST 2023

The call is

            if ( ( ret = rsslIoctl(thr->channel->pRsslChannel, (RsslIoctlCodes)RSSL_TRACE, (void *)&traceOptions, &error) != RSSL_RET_SUCCESS) ) {               

...
log error

            }
        }

The traceOptions are shown below I'm using RSSL_TRACE_TO_FILE_ENABLE|RSSL_TRACE_TO_MULTIPLE_FILES|RSSL_TRACE_PING_ONLY

(gdb) p traceOptions 
$1 = {traceMsgFileName = 0x7fffdbffc160 "/workspaces/cdev/datasrcs/sslsrc/acctests-rto/var/upasrc-8ee48f0f3b09-upa", traceMsgMaxFileSize = 1000, traceFlags = 304}

BTW - I know 1000 is small, I picked it to test out the cycling.

But the file size goes above 1000

-rw-rw-r-- 1 dev dev 3564 Nov 30 11:52 var/upasrc-8ee48f0f3b09-upa1701345002160.xml

Contents

<!-- Outgoing Ping (Channel IPC descriptor = 68) -->
<!-- Time: 11:57:48:558 -->
<!-- End Message (Channel IPC descriptor = 68) -->
<!-- Incoming Ping (Channel IPC descriptor = 68) -->
<!-- Time: 11:57:58:554 -->
<!-- End Message (Channel IPC descriptor = 68) -->
<!-- Outgoing Ping (Channel IPC descriptor = 68) -->
<!-- Time: 11:57:58:559 -->

When I alter traceFlags I get changes in what is logged as expected but the cycling never works.

L-Karchevska commented 10 months ago

@andysCaplin Thank you for bringing up this issue! We created an internal Jira to investigate it.

andysCaplin commented 10 months ago

I managed to create a debug version of the library I can confirm that if I set enable + ping only + multiple files that

If I also set the read and write flags then_rsslTraceStartMsg() is called and the log does cycle, but it seems to write such big blocks in one go that the size 1000 is too small and the files are always bigger which is understandable.

The main thing I need is to be able to log pings only and have the log cycling.

vlevendel commented 9 months ago

@andysCaplin XML tracing is typically not recommended in production for long term use. Therefore, we didn't extend the log rolling functionality to this area. We will consider this an enhancement.

vlevendel commented 5 months ago

RTSDK 2.2.0.L1 addresses this issue. Please let us know if you have further concerns. Closing.