Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4416

Get the perf version function return fail

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.26.0
    • Fix Version/s: 0.28.0
    • Component/s: c++ api
    • Labels:
      None
    • Environment:

      Suse SLE 12 SP1

      Description

      When check the perf version with the "perf::version" gets the command output of "perf --version". The command return string includes a "return key". It cause the version parse fails. If add the strings::trim, the issue is fixed.

      The old code:

      Future<Version> version()
      {
        internal::Perf* perf = new internal::Perf({"--version"});
        Future<string> output = perf->output();
        spawn(perf, true);
      
        return output
          .then([](const string& output) -> Future<Version> {
            // Trim off the leading 'perf version ' text to convert.
            return Version::parse(strings::remove(
                output, "perf version ", strings::PREFIX));
          });
      };
      

      Change to below, issue is fixed:

      Future<Version> version()
      {
        internal::Perf* perf = new internal::Perf({"--version"});
        Future<string> output = perf->output();
        spawn(perf, true);
      
        return output
          .then([](const string& output) -> Future<Version> {
            // Trim off the leading 'perf version ' text to convert.
            return Version::parse(strings::trim(strings::remove(
                output, "perf version ", strings::PREFIX)));
          });
      };
      

        Attachments

          Activity

            People

            • Assignee:
              bmahler Benjamin Mahler
              Reporter:
              l36807 Jingang Li
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: