New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config objects preceded by an inline destination are ignored #2820
Comments
Hi,
The reason for multiplexers is that the next pointer for a non-inline
destination cannot be used. So the multiplexer is always inline, its list
of next hops should contain a reference to the destination group.
I think that the inline destinations being a sequence should not cause
problems.
We could discuss this via phone or slack or similar to find a good enough
solution.
László Várady <notifications@github.com> ezt írta (időpont: 2019. júl. 5.,
P 14:24):
… syslog-ng Version of syslog-ng
syslog-ng v3.22.1
Issue
The following configuration will not send any logs to d_asd:
@Version: 3.22
destination d_asd {
network("127.0.0.1" port(4448));
};
log {
source { network(port(4444)); };
destination {
network("127.0.0.1" port(4447) );
};
destination(d_asd);
flags(flow-control);
};
The cfg graph built from this config is incorrect. Changing the order of
the 2 destinations (listing the inline destination last) fixes the issue.
Root cause
Inline destinations are compiled as sequences (cfg_tree_compile_sequence()),
where no multiplexer is created for other destinations. In case of
general/non-inline destinations (cfg_tree_compile_reference()), the
multiplexer is there:
https://github.com/balabit/syslog-ng/blob/1742b11e5cfa6544ece38aaecde96e9b423d61c5/lib/cfg-tree.c#L842-L851
Unfortunately, it seems syslog-ng creates a new multiplexer for *every*
non-inline destination instead of adding a hop to the previous one. I
don't know the reason, but we could improve on this too.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2820>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFOK5W52JWZ65DE6TPRJZDP544QTANCNFSM4H6K3FQA>
.
|
Is it possible that the problem depends on the types of the config elements? I checked with an inline file destination and a network destination, and it works for me:
However, with the config example in the ticket, I also experience the problem. |
After looking into the matter deeper here is what I found out. If I swap the order of an inline and normal destination, the config graph looks substantially different. Showing a few examples: The file destination and the network destination are linked into the same chain serially. One would think how this can work at all. And the trick is that the
Technically it should look like one long chain (similar to the file-network graph), but the lower part is disjoint. It is disjoint at: syslog-ng/modules/afsocket/afsocket-dest.c Line 546 in 4b22d46
That code expects I was thinking how this should be resolved but I do not have any plan yet. The analogous solution would be that instead of Another thing that feels a little off, that now no destinations attach their workers to themselves, because they might not be a terminal point in the graph. Conceptually, me feels natural that a destination should be a terminal point in the graph. It also feels strange that if I change the order of two destinations, the config graph looks so differently (single chain vs fork). @bazsi could you give me some hint how to fix this? |
I also feel it is right that destinations are terminal nodes in the graph. We obviously don't chain sources, but we should not chain destinations either in my opinion. [I removed the misleading part of this comment, so I have now 0 real reason why we should use a multiplexer 😄.] |
Sorry, I was not right about the flow control part, |
We want to leave pipe-next available to use for destinations. Prior this patch, pipe-next was used by the config graph to pass messages forward in a sequence layout. But pipe-next was overridden by network destination (pointing to LogWriter), hence disjointing the config graph. This patch links destinations in T form, instead of single link. ``` * (endpoint of sequence) | V * (multiplexer) -(next-hop)-> destination - (pipe-next*) -> logwriter | (pipe-next) | V * (rest of the sequence) ``` That way destinations are free to use the pipe-next* Fixes: syslog-ng#2820 Signed-off-by: Antal Nemes <antal.nemes@balabit.com>
syslog-ng
Version of syslog-ng
syslog-ng v3.22.1
Issue
The following configuration will not send any logs to
d_asd
:The cfg graph built from this config is incorrect. Changing the order of the 2 destinations (listing the inline destination last) fixes the issue.
Root cause
Inline destinations are compiled as
sequences
(cfg_tree_compile_sequence()
), where no multiplexer is created for other objects. In case of general/non-inline destinations (cfg_tree_compile_reference()
), the multiplexer is there:https://github.com/balabit/syslog-ng/blob/1742b11e5cfa6544ece38aaecde96e9b423d61c5/lib/cfg-tree.c#L842-L851
Unfortunately, it seems syslog-ng creates a new multiplexer for every non-inline destination instead of adding a
hop
to the previous one. I don't know the reason, but we could improve on this too.The text was updated successfully, but these errors were encountered: