Stream: t-compiler

Topic: incr session finalizing


Zoxc (Jan 10 2020 at 09:06, on Zulip):

@mw Is there some particular reason we run finalize_session_directory after linking?

mw (Jan 10 2020 at 09:07, on Zulip):

One reason could be that we don't want the directory to be finalized if there are any linking errors

mw (Jan 10 2020 at 09:08, on Zulip):

but I don't know if that is even validated properly at the moment

mw (Jan 10 2020 at 09:08, on Zulip):

other than that I think the session directory will only contain pre-linking artifacts

mw (Jan 10 2020 at 09:09, on Zulip):

at least as long as we don't do any incremental linking

mw (Jan 10 2020 at 09:10, on Zulip):

but the main reason it's done this way is probably that it was a safe choice and there was no reason to do it earlier at the time

Zoxc (Jan 10 2020 at 09:12, on Zulip):

I made it run in parallel with linking, let's see if any errors pop up.

mw (Jan 10 2020 at 09:13, on Zulip):

that's probably fine

mw (Jan 10 2020 at 09:14, on Zulip):

how much work is being done in finalize_session_directory these days? If it is just renaming the directory, then it probably doesn't matter

Zoxc (Jan 10 2020 at 09:14, on Zulip):

Takes 0.3 seconds for syntex_syntax

mw (Jan 10 2020 at 09:23, on Zulip):

that might be the call to garbage_collect_session_directories

mw (Jan 10 2020 at 09:24, on Zulip):

we should certainly keep this change in mind if any bug reports come in

mw (Jan 10 2020 at 09:25, on Zulip):

these filesystem operations often cause hard to reproduce bugs and behavior can vary quite a bit between platforms, filesystems, OS versions, etc.

mw (Jan 10 2020 at 13:17, on Zulip):

I've taken a look at finalize_session_directory and it does read sess.has_errors_or_delayed_span_bugs(). If anything in linking can change that value then I am against doing the two things in parallel, since the finalization outcome would depend on a race.

Zoxc (Jan 10 2020 at 22:30, on Zulip):

We can just read that before spawning it off

mw (Jan 13 2020 at 09:24, on Zulip):

I wonder if there is a way to make this safe. E.g. by making sure that linking and finalization don't access shared mutable state (like the session directory).

Zoxc (Jan 13 2020 at 10:22, on Zulip):

I did notice that something still accessed the session directory while linking, not sure what though.

Last update: Jan 21 2020 at 08:15UTC