Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] ProcessClosure.terminate() hangs on build job termination by user

Title: ProcessClosure.terminate() hangs on build job termination by user

Hi - Anyone ever have any problems with build jobs that hang? I've seen this in the past in CDT 3.1 under MBS and now I'm seeing it frequently using a custom builder where we are using a wrapper around CommandLauncher.execute( ). This is a bit hard to reproduce and it ususally just takes building and stopping until you can get it to hang

What I'm seeing is that under CommandLauncher.waitAndRead( ), if the user cancels the job then ProcessClosure.terminate() is called.

        // Operation canceled by the user, terminate abnormally.
        if (monitor.isCanceled()) {
        closure.terminate();
        state = COMMAND_CANCELED;
        setErrorMessage(CCorePlugin.getResourceString("CommandLauncher.error.commandCanceled")); //$NON-NLS-1$
        }


From here, the build hangs on occasion and you must force quit via the task manager (we're only on Windows OS). The culprit that blocks the build thread seems to be here:

if (!fOutputReader.finished()) {
        fOutputReader.waitFor();  << Never returns, what's the point in calling this?.
}

My question is, what is the point of trying to read any remaining output if the user has cancelled. Is there any harm is just removing any additional calls to read stdout and sdterr and just close them instead?

Thanks,
Tim


Back to the top