-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Improved ACLK memory management and shutdown sequence #8611
Conversation
Manage this branch in SquashTest this branch here: https://stelfragaclk-cleanup-8483-0qu6e.squash.io |
@stelfrag can you rebase on master as there seems to be conflict |
* Return success where an identical update command is found in the queue * Disabled cancelability for main ACLK thread to handle graceful shutdown * Fixed memory leak on incoming payload 'type_id' * Fixed memory leak on ACLK query thread shutdown
3027299
to
475db2f
Compare
In |
I see this in valgrind, can we determine if it comes from the ACLK code or somewhere else in Netdata?
|
and
Ignore this, it is completely wrong. |
Good point -- no need to push cleanup before that check |
No that looks good. It comes from the |
OK, tested this with cloud (after reinstalling |
after adding --num-callers=50 to valgrind you can see longer backtrace
|
That issue is caused by |
The call after the loop (that does not check the return value) can be removed. Perhaps we should check if All the tests look good though, I'm about to approve this. |
…ed and the ACLK main thread terminates immediately * Remove reduntant aclk_private_key generation
Yes I removed that call. Valgrind error went away |
Question: We disable thread cancelability before the main loop, but we have a cleanup handler registered and it is removed as the last step in the thread main.
|
Valgrind looks good now
|
The |
Yes :) But why.... If it is only being called in that way why are we using a cleanup handler? i.e. I know it is called in the normal flow, but it is never called in an abnormal flow. |
Guys ideally we shouldn't add anything posix thread spefic to facilitate the move to libuv threads. Thread cancelability is not supported in libuv. |
True, but without disabling cancel-ability the code after the main loop does not get called. The threads are killed before the netdata_exit flag is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests all work, random poking around seems stable. Changes to the code are good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Improved ACLK memory management and shutdown sequence
Fixes #8483
Summary
netdata_exit
variable.Component Name
ACLK
Test Plan
valgrind --undef-value-errors=no --leak-check=full -s <netdata executable>
ACLK failed to queue chart_update command
is goneACLK failed to queue chart_update command
in the error.log