Skip to content

rdar://38123690 (overlarge batches) and rdar://37865437 (task queue exec errors) #14976

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

Merged

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Mar 5, 2018

This fixes another assert @davidungar ran into testing batch mode, this time due to overlong command lines / overlarge batches (to be fixed when we move to passing OFMs, but not fixed yet). For the time being we just cap at total/TOO_MANY_FILES, which might still not be small enough given the auxiliary file amplification, but it's enough to pass a credible test, and none of this is especially precise in the existing code either (I think the actual limit arises from colliding with ARG_MAX, which we're definitely not measuring!)

Along the way, fixes (by necessity) the cause of an assert @ddunbar hit, wherein the driver doesn't trap exec-failure properly; there's not a lot we can recover in these cases, but we can do better than throwing an unrelated assert (or not trapping at all in release builds). The overlong args were triggering exec failure, but then so do all sorts of things, such as exec'ing a nonexistent binary.

rdar://37865437
rdar://38123690

@graydon graydon requested a review from jrose-apple March 5, 2018 10:19
@graydon
Copy link
Contributor Author

graydon commented Mar 5, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 5e93bd01323d228984d27c99277aae4b3c08302d

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Hmm…I'm not convinced TOO_MANY_FILES is good enough. Previously we had N inputs and N primary outputs but now we also have N of each supplementary output. I guess it's better if we have something that works in more circumstances right now, though.

@@ -29,6 +29,9 @@ namespace driver {
class Job;
class OutputInfo;

/// The limit for passing a list of files on the command line.
const size_t TOO_MANY_FILES = 128;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this static, there's no need for it to have a stable address.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

// error" at some stage before even calling us with a process exit /
// signal (or else a poll failed); unfortunately the task causing it
// was dropped on the floor and we have no way to recover it here,
// so we report a very poor, generic error.
Copy link
Contributor

Choose a reason for hiding this comment

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

Better than nothing, and I'm glad we caught it. Maybe this should be a FIXME, though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@graydon graydon force-pushed the rdar-38123690-task-queue-exec-errors branch from d8faf61 to 3c8c151 Compare March 5, 2018 20:29
@graydon
Copy link
Contributor Author

graydon commented Mar 5, 2018

@jrose-apple I'm not convinced TOO_MANY_FILES is great either; have rewritten this with a slightly-more-meaningful test of whether the overall command-line length is too long, with a rebatching cycle (at twice the number of partitions / half the batch size) if it fails.

@graydon
Copy link
Contributor Author

graydon commented Mar 5, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - 5e93bd01323d228984d27c99277aae4b3c08302d

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 5e93bd01323d228984d27c99277aae4b3c08302d

@graydon graydon force-pushed the rdar-38123690-task-queue-exec-errors branch from 3c8c151 to 6c9029e Compare March 5, 2018 21:43
@graydon
Copy link
Contributor Author

graydon commented Mar 5, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - 3c8c151d1410866980c7f226528dde9a9548f159

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 3c8c151d1410866980c7f226528dde9a9548f159

@graydon graydon merged commit babd837 into swiftlang:master Mar 5, 2018
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