tgho-brrrr opened a new issue, #36331:
URL: https://github.com/apache/doris/issues/36331

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   doris == 2.1.4
   
   ### What's Wrong?
   
   The connections started by adbc_driver_flightsql or adbc_driver_manager both 
leave hanging processes:
   
   ```
   CurrentConnected: Yes
                 Id: 0
               User: admin
               Host: 0.0.0.0:0
          LoginTime: 2024-06-14 14:32:42
            Catalog: internal
                 Db:
            Command: Sleep
               Time: 8
              State: OK
            QueryId: 972dbf17efa94eae-969e2b5697b4d0e4
               Info: select 1;
   ```
   
   After many queries the server will not accept any new connections to the DB 
unless we restart the FE.
   
   ### What You Expected?
   
   The process should be killed when the connection is closed
   
   ### How to Reproduce?
   
   Assuming arrow_flight_sql_port is 9090
   
   Run this python script:
   
   ```
   conn = flight_sql.connect(uri='grpc://127.0.0.1:9090', db_kwargs={
       adbc_driver_manager.DatabaseOptions.USERNAME.value: "admin",
       adbc_driver_manager.DatabaseOptions.PASSWORD.value: ""
   })
   cursor = conn.cursor()
   cursor.execute("SELECT 1;")
   cursor.close()
   conn.close()
   ```
   
   Then in the mysql console:
   `show processlist;`
   
   You should notice that the process hangs there indefinitly
   
   
   ### Anything Else?
   
   I also tried with the low-level adbc_driver_manager, and get the same issue, 
the problem should be on Doris side. I also tried to check that the driver 
indeed closes the connection by calling `conn.cursor()` after `conn.close()`, 
and I get an error, so the driver does it's part of the job, but it seems to 
not kill the process.
   
   db = adbc_driver_flightsql.connect(uri="grpc://127.0.0.1:9090", db_kwargs={
       adbc_driver_manager.DatabaseOptions.USERNAME.value: "admin",
       adbc_driver_manager.DatabaseOptions.PASSWORD.value: "",
   })
   conn = adbc_driver_manager.AdbcConnection(db)
   stmt = adbc_driver_manager.AdbcStatement(conn)
   stmt.set_sql_query('select 1;')
   stream, rows = stmt.execute_query()
   stmt.close()
   conn.close()
   db.close()
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to