-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
loggerd: eliminate recursion from handle_encoder_msg #33453
base: master
Are you sure you want to change the base?
Conversation
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes. |
0c3b360
to
9352d2f
Compare
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes. |
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
9352d2f
to
900b800
Compare
Can we break this up at all? |
900b800
to
7488553
Compare
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
7488553
to
a65b945
Compare
a65b945
to
d1db5ce
Compare
@deanlee I'm ready to merge this PR, but it still doing too many things. can we break it up? ideally we just have one targeted PR at removing the recursion, then a followup that does the other things. |
d1db5ce
to
b1f5cd8
Compare
Done. I’ve simplified this PR by removing all other changes, leaving only the refactor that moves the encoded data writing logic from |
b1f5cd8
to
226b934
Compare
@deanlee Do you have a way to reproduce memory leaks or weird behaviors when loggerd/encoderd get out of sync ? |
If the encoderd restarts while loggerd is logging and there are encoded messages already queued in loggerd's queue, it will recursively call The current recursive approach adds unnecessary complexity and introduces synchronization bugs without offering real benefits. I'll look into adding a new test case later to capture this synchronization issue. |
Changes:
write_encode_data
,handle_encoder_msg
with direct calls towrite_encode_data
for writing queued packets in the new segment. This change prevents potential crashes by handling queued packets safely, even if they are out of sync with the encoderd.3. Improved Memory Management: Replaced raw pointers with std::unique_ptr for managing Message objects, improving memory safety.4. Removed Redundant Parameter: Removed the
service.name
parameter fromhandle_encoder_msg
, as it duplicates there.publish_name
value already available through there
parameter.Resolves #28857