Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30583

Only call os.fsync if -o option is not default value in collect_resource_info.py

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.13
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      TIG 2017-09-11

      Description

      If we use the stdout as the output stream, a call to os.fsync(fp.fileno()) will fail.

      buildscripts/collect_resource_info.py -i 3
      {"command": "./executables/linux_amd64/main", "cpu_sys": 0.04, "cpu_user": 0.02, "io_read": 0, "io_wait": 0, "io_write": 53248, "mem_avail": 56044023808, "mem_total": 67419119616, "mem_used": 13115392, "num_cpus": 40, "num_threads": 6, "pid": 32807, "ppid": 13988, "timestamp": {"$date": 1502306090356}}
      Traceback (most recent call last):
        File "buildscripts/collect_resource_info.py", line 107, in <module>
          main()
        File "buildscripts/collect_resource_info.py", line 103, in main
          os.fsync(fp.fileno())
      OSError: [Errno 22] Invalid argument
      

      Need to conditionally call os.fsync if options.output != '-' or potentially remove this call altogether since we already have line_buffered set. Will have to test.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: