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

[arp_update]: Use parent script PID for logger calls #19219

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

theasianpianist
Copy link
Contributor

@theasianpianist theasianpianist commented Jun 6, 2024

Why I did it

When a script calls the logger utility, each individual call gets its own PID assigned. Rsyslogd creates an internal rate-limit object per PID that sends a log message. If the logger utility is called repeatedly, it will cause rsyslogd memory usage to increase permanently since a rate-limit object is being created for each call.

Work item tracking
  • Microsoft ADO 28263484:

How I did it

Override the logger command in the arp_update script to use the --id argument to specify the parent script PID that rsyslogd should use for rate limiting.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@prsunny
Copy link
Contributor

prsunny commented Jun 6, 2024

Could you please update description and whats the behavior before and after this change?

@prsunny
Copy link
Contributor

prsunny commented Jun 8, 2024

@kperumalbfn , can you please review/merge?

Copy link
Contributor

@kperumalbfn kperumalbfn left a comment

Choose a reason for hiding this comment

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

LGTM

@kperumalbfn kperumalbfn merged commit ff77018 into sonic-net:master Jun 8, 2024
19 of 20 checks passed
@prsunny
Copy link
Contributor

prsunny commented Jun 9, 2024

@theasianpianist , can you confirm it is tested for the following scenarios and logging works as expected?

  1. restart arp_update script
  2. restart rsyslogd

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jun 10, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #19258

mssonicbld pushed a commit that referenced this pull request Jun 10, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@theasianpianist
Copy link
Contributor Author

@theasianpianist , can you confirm it is tested for the following scenarios and logging works as expected?

  1. restart arp_update script
  2. restart rsyslogd

Co firmed, logging works as expected here

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jun 12, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #19292

mssonicbld pushed a commit that referenced this pull request Jun 15, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
arun1355492 pushed a commit to arun1355492/sonic-buildimage that referenced this pull request Jul 26, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
MuLinForest pushed a commit to MuLinForest/sonic-buildimage that referenced this pull request Aug 6, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
MuLinForest pushed a commit to MuLinForest/sonic-buildimage that referenced this pull request Aug 6, 2024
theasianpianist added a commit to theasianpianist/sonic-buildimage that referenced this pull request Aug 28, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
yxieca pushed a commit that referenced this pull request Aug 28, 2024
[arp_update]: Use parent script PID for logger calls

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants