anchor.diff:      }
   
       final sw = Stopwatch()..start();
  -    DartdocResult r = await runDartdoc(true);
  +    DartdocResult r = await runDartdoc();
       sw.stop();
       logger.info('Running dartdoc for ${job.packageName} ${job.packageVersion} '
           'completed in ${sw.elapsed}.');
  -    if (r.wasTimeout) {
  -      r = await runDartdoc(false);
  +    final shouldRetry = r.wasTimeout ||
  +        // TODO: remove this after https://github.com/dart-lang/dartdoc/issues/2101 gets fixed
  +        (!r.wasSuccessful &&
  +            r.processResult.stdout.toString().contains(
  +                "type 'FunctionTypeImpl' is not a subtype of type 'InterfaceType'"));
  +    if (shouldRetry) {
  +      r = await runDartdoc(isReduced: true);
       }
   
       _appendLog(logFileOutput, r.processResult);
  
positive.code:       await optionsFile.delete();
      }
  
      Future<DartdocResult> runDartdoc(bool validateLinks) async {
        final args = [
          '--input',
          pkgPath,
  
negative.code:         siteRoot,
          '--rel-canonical-prefix',
          canonicalUrl,
          if (!isReduced) '--link-to-remote',
          '--exclude',
          _excludedLibraries.join(','),
          if (isReduced) '--no-validate-links',
        ];
        if (envConfig.toolEnvDartSdkDir != null) {
          args.addAll(['--sdk-dir', envConfig.toolEnvDartSdkDir]);
        }
  