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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.5.13
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Fully Compatible
    • ALL
    • TIG 2017-09-11

      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.

            Assignee:
            eddie.louie Eddie Louie
            Reporter:
            eddie.louie Eddie Louie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: