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

Use selectable event to terminate logger thread #848

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

Junchao-Mellanox
Copy link
Collaborator

Why I did it

settingThread of Logger select DB change with 1000ms timeout. It causes up to 1 second wait while destroy the logger instance. The 1 second wait is not necessary and can be replaced by SelectableEvent

Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. Add a new member m_stopEvent with type SelectableEvent
  2. settingThread also selects m_stopEvent
  3. settingThread exits if m_stopEvent comes

How to verify it

Manual test

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

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

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)

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @kcudnik , could you please kindly review and provide comments?

@kcudnik
Copy link
Contributor

kcudnik commented Jan 15, 2024

This looks good, is this one second causing some issues ?

@Junchao-Mellanox
Copy link
Collaborator Author

This looks good, is this one second causing some issues ?

I would like to use this logger in Python, and the python code could be referred by CLI. It causes a 1 sec delay in CLI call.

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @kcudnik , I have fixed the comments, could you please check?

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @kcudnik , could you help merge?

@kcudnik kcudnik merged commit 2711f6f into sonic-net:master Jan 16, 2024
13 checks passed
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.

3 participants