|
Managed to reproduce this with the following script.
#!/usr/bin/env python3
|
|
import pymysql
|
import threading
|
import time
|
import requests
|
|
running = True
|
|
def run():
|
global running
|
while running:
|
conn = pymysql.Connect(host='127.0.0.1', port=4006, user='maxuser', password='maxpwd', database='test')
|
|
with conn.cursor() as c:
|
for _ in range(0, 10):
|
c.execute("SELECT 1")
|
c.fetchall()
|
|
|
threads = []
|
|
for i in range(0, 20):
|
threads.append(threading.Thread(target=run))
|
|
for t in threads:
|
t.start()
|
|
start = time.time()
|
|
while time.time() - start < 10:
|
requests.get("http://127.0.0.1:8989/v1/sessions")
|
|
running = False
|
|
for t in threads:
|
t.join()
|
|