Skip to content

taskmaster in medium to large build with -j count 2 or above fails to removes executed nodes #2265

Closed

Description

@bdbaddog

This issue was originally created at: 2008-12-01 11:20:03.
This issue was reported by: jason_at_intel.

jason_at_intel said at 2008-12-01 11:20:03

The taskmaster does not remove the node with executed state all the time when doing build with -j2 or higher. It seems that the code build completely, however Scons will error out with a message such as (this case may not reproduce the same way.. the next time it might be a different set of headers):

scons: done building targets.
 
scons: *** Found dependency cycle(s):
  Internal Error: no cycle found for node sdks\debug_win32_x86\tpss_1.0.63 \include\tpss1\tpssA.h (<SCons.Node.FS.File instance at 0x10DE5300>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86_64\tpss_1.0.63 \include\tpss1\tpssB.h (<SCons.Node.FS.File instance at 0x11A36440>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86\tpss_1.0.63 \include\tpss1\tpssC.h (<SCons.Node.FS.File instance at 0x10DE27B0>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86_64\tpss_1.0.63 \include\tpss1\tpssA.h (<SCons.Node.FS.File instance at 0x11A29E68>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86_64\tpss_1.0.63 \include\tpss1\tpssC.h (<SCons.Node.FS.File instance at 0x11A294E0>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86_64\tpss_1.0.63 \include\tpss1\tpssD.h (<SCons.Node.FS.File instance at 0x11A29C10>) in state executed
  Internal Error: no cycle found for node sdks\debug_win32_x86_64\tpss_1.0.63 \include\tpss1\tpssE.h (<SCons.Node.FS.File instance at 0x11A298C8>) in state executed

However some digging into SCons show that the code reporting the error does not notice that the node was executed, and just assumes if a node is here that it must be an error. I simple fix is to check the state and if the taskmaster left it there in a executed state remove it from the node list and don't consider that node to be a error. The reason why the taskmaster fails to remove it is unknown to me. It is very hard to reproduce in a simular behavior, it does show easily in large builds. I think one has to define a lot of nodes to be processed for this to reproduce. a simple small sample does not reproduce this for me, or I have been unable to make a small sample case as of yet.

If needed, I can make a patch to make the problem go away via checking the state, and ignoring it when in executed state.

gregnoel said at 2008-12-02 13:51:13

Can you confirm that you're running this with the specified checkpoint? We had a bug like this in a prior release which has since been fixed, so if you've accidentally specified the wrong version, it may already be fixed.

If that is the correct version, a patch is always welcome...

jason_at_intel said at 2008-12-03 08:22:12

Created an attachment (id=541)
Old patch we had used with Scons 0.98.85

jason_at_intel said at 2008-12-03 08:24:44

We re tested with a clean install of SCons with python 2.5.1, 2.5.2.2 and 2.6 problem show up here with latest Scons drop.

This is a hacky patch which fixed the issues in taskmaster.py (line ~950)

    def cleanup(self):
        """ Check for dependency cycles.  """
        stop = True
        if self.pending_children:
            for node in self.pending_children:
                cycle = find_cycle([node], set())
                if cycle:
                    stop = False
                elif StateString[node.get_state()] == "executed":
                    continue
                else:
                    stop = False
        if stop == True:
            return
        if self.pending_children:
            desc = "Found dependency cycle(s):\n"
            for node in self.pending_children:
                cycle = find_cycle([node], set())
                if cycle:
                    desc = desc + "  " + string.join(map(str, cycle), " -> ") + "\n"
                else:
                    desc = (
                        desc
                        + "  Internal Error: no cycle found for node %s (%s) in state %s\n"
                        % (node, repr(node), StateString[node.get_state()])
                    )
 
            raise SCons.Errors.UserError, desc

what we used originally in 0.98.85 was the attached taskmaster.py file. It was some patch that was found in some bug in to a taskmaster issue in SCons... I can't find it again however. I have not tested this with anything newer as I noticed the taskmaster had some different changes in it in the 1.0 and beyond releases.

The above "hacky" patch however works around the issue by ignoring executed nodes. It does not solve the core issue inside the taskmaster however. I have tested it with our code and the issue does not reproduce.

Jason

dvitek said at 2008-12-03 12:02:56

We are also sometimes seeing this here when using -j2 with 1.1.0.d20081104. Similarly, in this case, it seems the build went through OK except for the internal errors.

Additionally, we see a similar (but probably separate) bug where failed compiles of certain files cause SCons to produce this error message when it finishes independent of -j. This bug was introduced in the .98 or possibly .97 series, but did not exist in .96. I am aware that a bug with these symptoms was fixed earlier, but the upgrades did not resolve the issue.

I intend to track the second variant eventually, but it might be a while.

gregnoel said at 2008-12-04 22:44:13

Bug party triage. Steven to figure out if it's a regression that should be fixed in 1.2 and fix it if so. If not, either assign to a reasonable milestone and priority or return to triage with an analysis.

mortenelo said at 2008-12-05 02:48:46

This seems to be related to issue 2116, for which Benoit has provided a patch as well.

jason_at_intel said at 2008-12-05 11:38:50

#2116 was the orginal bug. That I coudl not find. I only had the code that was submitted here. Make sure credit for the "better" fix goes to the corrcte person.

stevenknight said at 2009-01-21 08:24:00

Fixed back in 1.1.0.d20081207 by r3809:

https://scons.tigris.org/ds/viewMessage.do?dsForumId=1268&dsMessageId=980659 [tigris link dead]
https://scons.tigris.org/ds/viewMessage.do?dsForumId=5062&dsMessageId=980660 [tigris link dead]

Thanks,

jason_at_intel attached Taskmaster.py at 2008-12-03 08:22:12.

Old patch we had used with Scons 0.98.85

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions