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

Fix a bunch of bugs plus an improvement to log_parser that I used to debug this. #302

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kumpera
Copy link
Contributor

@kumpera kumpera commented Apr 21, 2021

parser.py can will now parse all preamble messages in a file.

rl.net.cli was not disposing its live model, now it does.

Introduced some basic logging to the batching process so we can do basic monitoring without having to a debugger or adding printf statements.

The extra logging turned out to be a problem because at-exit flushing was done from async_batch dtor and accessing a bunch of dangling pointers - fun stuff!

I fixed that by moving the flushing to live_model_impl, which owns everything so its dtor can do it safely.

Rodrigo Kumpera added 5 commits April 21, 2021 09:22
Add a dtor to live_model_impl and flush the queues from it.

Why flushing from live_model_impl is ok but from async_batcher is not?

async_batcher holds un-owned references to a lot of stuff and the
expectation is that those objects won't be valid during destruction.

Flushing data in async_batcher requires those dangling pointers to
be valid so we cannot do it from the dtor.

Then why is it ok to do it from live_model_impl dtor? As it turns out,
it holds owning references to pretty much everything that's needed for flushing.

Did you say pretty much? Yes, there are a lot of un-owned references in
live_model_impl as well but they look related to initialization only.
Life is too short otherwise.
Copy link
Member

@ataymano ataymano left a comment

Choose a reason for hiding this comment

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

LGTM. Although looks like there is some consistent issue with indentation (maybe spaces vs tabs?)

@kumpera
Copy link
Contributor Author

kumpera commented Apr 23, 2021

LGTM. Although looks like there is some consistent issue with indentation (maybe spaces vs tabs?)

Yes, formatting is all bad because I used VS which I can't figure out how to make it respect our style. I'll fix it using clang-fmt before committing.

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