Skip to content
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

afinter: adjusting window size for internal mark mode #2146

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

furiel
Copy link
Collaborator

@furiel furiel commented Jun 27, 2018

Prior this patch, internal mark mode messages were generated independently
from flow control. This means mark mode messages were sent even if the
destination cannot handle messages.

With the patch, mark mode messages can fill now the available window,
as such, internal source can be suspended properly because of them,
and no mark mode messages are generated in that case.

How to test?

Leave syslog-ng running with -Fevd without a destination. You will see that around 100 mark mode messages, the mark mode generation stops. Without this patch, mark mode messages are generated infinitely.

@version: 3.16

options {
  time-reopen(1);
  mark-freq(1);
};

log {
  source { internal(); };
  source { network(port(4444) transport(tcp)); };
  destination { network(localhost port(5555) transport(tcp) mark-mode(internal)); };
  flags(flow-control);
};

Motivated by the discussion of @bazsi @MrAnno @lbudai in
#2129

Prior this patch, mark mode messages were generated independently
from flow control. This means mark mode messages were sent even if the
destination cannot handle messages.

With the patch, mark mode messages can fill now the available window,
as such, internal source can be suspended properly because of them,
and no mark mode messages in that case.

Signed-off-by: Antal Nemes <antal.nemes@balabit.com>
@bazsi
Copy link
Collaborator

bazsi commented Jun 27, 2018

looks good to me.

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@furiel furiel changed the title afinter: adjusting window size for mark mode afinter: adjusting window size for internal mark mode Jun 28, 2018
Copy link
Collaborator

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afinter_message_posted() pushes the message into internal_msg_queue.

afinter_source_post() pops the message and calls log_source_post(), where the window size is decremented and ack_needed is set to TRUE.

@MrAnno MrAnno merged commit 1df43b5 into syslog-ng:master Jun 28, 2018
@furiel furiel deleted the afinter-flow-control-mark-mode branch November 5, 2019 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants