<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:303658685;
        mso-list-type:hybrid;
        mso-list-template-ids:468094286 67567617 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:1223517286;
        mso-list-type:hybrid;
        mso-list-template-ids:-1217652100 67567631 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Folks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">for a customer I have to verify the behavior of the logger in its system
<i>(Linux debianVM 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux</i>), which is journald (<i>systemd 241 (241)</i>).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For this, I have written some unit tests that work all well, when executed separately. But running together they lead to some erroneous behavior that I cannot explain -  maybe you have an idea what’s going wrong…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Essentially there are 4 tests with increasing complexity:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo1"><span lang="EN-US">The first one just sends 5 small messages (~20 bytes) with priority Debug, Info, Warning, Error and Critical (the customer only needs these priorities). After that,
 the logger’s storage is synchronized and analyzed if all messages have been arrived correctly (via APIs sd_journal_...).<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo1"><span lang="EN-US">The second test sends 10,000 small messages (~20 bytes) to the logger with priority Debug. After that, the logger’s storage is synchronized and analyzed if all messages
 have been arrived correctly (via APIs sd_journal_...).<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo1"><span lang="EN-US">The third one sends 10,000 big messages (~10,000 bytes) to the logger with priority Debug, which are good to compress. After that, the logger’s storage is synchronized
 and analyzed if all messages have been arrived correctly (via APIs sd_journal_...).<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo1"><span lang="EN-US">The last one sends 10,000 big messages (~10,000 bytes) to the logger with priority Debug, which are hard to compress. After that, the logger’s storage is synchronized
 and analyzed if all messages have been arrived correctly (via APIs sd_journal_...).<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The following observations can be made now:<o:p></o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo2"><span lang="EN-US">If all tests are started separately, all is fine.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo2"><span lang="EN-US">If test 3 + 4 are started together, all is fine.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo2"><span lang="EN-US">If test 2 + 3 + 4 are started together, all is fine.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo2"><span lang="EN-US">If test 1 + 2 + 3 + 4 are started together, test 4 has lost one message, which is always the last one.<o:p></o:p></span></li></ul>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In my test collection there is another quite simple test, which is a bit more complex than test 1 - let's call it 1a. When test 1 + 1a + 2 + 3 + 4 are started together, test 4 loses about 10 messages, which are always
 the last messages sent to the logger. This can be verified just by using the command
<i>journalctl –no-pager -n 20</i>.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Suspecting that this may be a timing issue, I have delayed the execution of test 4 by 10 seconds, but without success. Does anyone have an idea for this behavior?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Attached next you will find the corresponding configuration.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">With regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Andreas<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[Journal]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Storage=persistent<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Compress=yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Seal=yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">SplitMode=none<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#SyncIntervalSec=5m<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RateLimitIntervalSec=30s<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RateLimitBurst=10000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">SystemMaxUse=500M<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#SystemKeepFree=<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">SystemMaxFileSize=50M<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">SystemMaxFiles=13<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RuntimeMaxUse=<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RuntimeKeepFree=<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RuntimeMaxFileSize=<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#RuntimeMaxFiles=100<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">MaxRetentionSec=12month<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxFileSec=1month<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#ForwardToSyslog=yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#ForwardToKMsg=no<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#ForwardToConsole=no<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#ForwardToWall=yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#TTYPath=/dev/console<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxLevelStore=debug<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxLevelSyslog=debug<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxLevelKMsg=notice<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxLevelConsole=info<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#MaxLevelWall=emerg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#LineMax=48K<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#ReadKMsg=yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>