Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-50036

[CLI] CSV pump doesn't seem to close a file properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 7.1.0
    • 7.0.2
    • tools
    • Triaged
    • 1
    • Unknown

    Description

      What is the issue?
      When running couchbase-cli tests locally I noticed that one of the tests outputs the following ResourceWarning:

      127.0.0.1 - - [10/Dec/2021 11:51:59] "GET /close HTTP/1.1" 200 -
      ................../home/janu/cb/source/couchbase-cli/pump_csv.py:104: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/good-batchmgkmehdt.csv' mode='r' encoding='utf-8'>
        self.r = None
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      ../usr/lib/python3.8/unittest/suite.py:107: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmp2b656fqu.csv' mode='r' encoding='utf-8'>
        for index, test in enumerate(self):
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      ./usr/lib/python3.8/unittest/suite.py:107: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/no-idteqcd6ao.csv' mode='r' encoding='utf-8'>
        for index, test in enumerate(self):
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      /home/janu/cb/source/couchbase-cli/pump_csv.py:104: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/only-headers-r7jcz7jz.csv' mode='r' encoding='utf-8'>
        self.r = None
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      ....WARNING:root:no response for 30 seconds while there 1 active streams
      ....127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /pools/default/nodeServices HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /api/index HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /close HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /close HTTP/1.1" 200 -
      .127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /pools/default/nodeServices HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /getIndexMetadata?bucket=default HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /close HTTP/1.1" 200 -
      127.0.0.1 - - [10/Dec/2021 11:52:29] "GET /close HTTP/1.1" 200 -
      .....................................................
      ----------------------------------------------------------------------
      Ran 366 tests in 77.726s
       
      OK
      

      We should look into why this warning is being thrown and fix it.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            maks.januska Maksimiljans Januska
            maks.januska Maksimiljans Januska
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty