Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-17450

Thor leaks globally-cached MySQL connections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: 6.4.0
    • Fix Version/s: 6.4.0
    • Component/s: Plugins
    • Labels:

      Description

      From https://hpccsystems.com/bb/viewtopic.php?f=10&t=3993:

      Given a simple table

      CREATE TABLE TestTable (id int);
      

      with 10 records, if I run

      IMPORT MySQL;
      
      TestLayout := RECORD
        INTEGER Id;
      END;
      
      DATASET(TestLayout) LoadTestTable(INTEGER minLimit = 0) := EMBED(mySql : server('myserver'), database('mydb'), user('myuser'), password('mypass'), port('myport'))
        SELECT ID FROM TestTable WHERE ID > ?;
      ENDEMBED;
      
      LoadTestTable();
      LoadTestTable(5);
      

      the db connection gets closed (SHOW PROCESSLIST in MySql does not show any connections in sleep state).

      If I just append

      DATASET(
        [
          {'A', 1}, 
          {'B', 2}, 
          {'A', 3}, 
          {'C', 4}, 
          {'B', 5} 
        ], 
        {STRING S, INTEGER I}
      );
      

      at the end of that code, and run it all, the connection stays in the sleep state. Every time I run the code, a new connection is opened and remains open until the timeout (default 8h on MySql). After a while "mysql: Failed to connect (Too many connections)" happens.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                richardkchapman Richard Chapman
                Reporter:
                richardkchapman Richard Chapman
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: