Skip to content

possible race condition explanations #2165

Closed

Description

@bdbaddog

This issue was originally created at: 2008-08-06 11:22:59.
This issue was reported by: stevenknight.
stevenknight said at 2008-08-06 11:22:59

This is to record a possible race condition suggested by a colleague:

The main SCons thread that walks the DAG is responsible for calling
task.prepare(), which ends up calling the necessary per-Node prepare() function
to unlink a file before we try to create it.

It then puts the job on the queue and a separate worker thread is responsible
for actually trying to build the file.

The theory is that it's possible on Windows for some statefulness about the
file's existence (and being open) to be stuck after the main thread closes it,
and still in effect when the worker thread tries to access it.

One possibility here is that some virus-scanning software apparently hooks the
Windows analog to the close() call and locks the file for some indefinite amount
of time afterwards to make sure that everything is virus-free. That doesn't
really explain the potential unlink-in-prepare() scenario, but may be a source
of other issues where a second thread tries to access a file created by another
thread.

stevenknight said at 2008-08-18 16:47:59

Closing as dup; I'll update #2124 with the text.

*** This issue has been marked as a duplicate of 2124 ***

stevenknight said this issue is a duplicate of #2124 at 2008-08-18 16:47:59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions