Skip to content

Add heartbeat interval parameter.#3458

Merged
prsunny merged 8 commits intosonic-net:masterfrom
liuh-80:dev/liuh/add_heartbeat_flag
Jan 31, 2025
Merged

Add heartbeat interval parameter.#3458
prsunny merged 8 commits intosonic-net:masterfrom
liuh-80:dev/liuh/add_heartbeat_flag

Conversation

@liuh-80
Copy link
Copy Markdown
Contributor

@liuh-80 liuh-80 commented Jan 9, 2025

Add heartbeat interval parameter.

Why I did it

Make this feature can be disable, because log spam issue on small disk device:
sonic-net/sonic-buildimage#21157

Work item tracking
  • Microsoft ADO: 30594076

How I did it

Add heartbeat interval parameter. and disable heartbeat when interval is 0.

How to verify it

Pass all UT.

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

Add heartbeat interval parameter.

Link to config_db schema for YANG module changes

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

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 marked this pull request as ready for review January 12, 2025 00:40
@liuh-80 liuh-80 requested a review from prsunny as a code owner January 12, 2025 00:40
@liuh-80 liuh-80 requested a review from qiluo-msft January 12, 2025 00:57
case 'I':
if (optarg)
{
g_heart_beat_interval = atoi(optarg);
Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jan 14, 2025

Choose a reason for hiding this comment

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

g_heart_beat_interval

Could you add more parameter validation and error handling? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we treat 0 as error? an invalid string will also lead to 0.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

0 means disable heartbeat feature

case 'I':
if (optarg)
{
g_heart_beat_interval = atoi(optarg);
Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jan 14, 2025

Choose a reason for hiding this comment

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

g_heart_beat_interval

you may init g_heart_beat_interval before the while loop, instead of init global static var which the sequence is not well defined. #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit 257d32d into sonic-net:master Jan 31, 2025
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* Add heart beat interval parameter
* Disable feature when interval is 0

Why I did it
Make this feature can be disable, because log spam issue on small disk device:
sonic-net/sonic-buildimage#21157

Work item tracking
Microsoft ADO: 30594076
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
* Add heart beat interval parameter
* Disable feature when interval is 0

Why I did it
Make this feature can be disable, because log spam issue on small disk device:
sonic-net/sonic-buildimage#21157

Work item tracking
Microsoft ADO: 30594076

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
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.

4 participants