Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-196

Missing decrement of reference pointer (connection) when closing the cursor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.10
    • Fix Version/s: 1.0.11
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Python Version:
      3.8

      Description

      When closing a cursor the reference pointer for the corresponding connection object needs to be decremented to prevent leakage.

      How to repeat:

      import resource, mariadb
       
          ...
       
          def test_connection_ref(self):
              if is_maxscale():
                  self.skipTest("skip test (possible timeout)")
              last= 0
              for i in range(1,100000):
                  conn= create_connection()
                  cursor= conn.cursor()
                  cursor.close()
                  conn.close()
                  usage = resource.getrusage(resource.RUSAGE_SELF)
                  new= usage[2]
                  if (last > 0):
                      self.assertEqual(new, last)
                  last= new
      
      

      This doesn't affect Connector/Python 1.1.x

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              georg Georg Richter
              Reporter:
              georg Georg Richter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.