Merge pull request #21456 from nikitamikhaylov/zookeeper-secure-race

Fix race in SecureSocket
This commit is contained in:
Nikita Mikhaylov 2021-03-10 20:49:56 +03:00 committed by GitHub
commit 39b59e86b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

2
contrib/poco vendored

@ -1 +1 @@
Subproject commit fbaaba4a02e29987b8c584747a496c79528f125f
Subproject commit c55b91f394efa9c238c33957682501681ef9b716

View File

@ -1,6 +1,7 @@
import time
import threading
from os import path as p, unlink
from tempfile import NamedTemporaryFile
@ -174,6 +175,20 @@ def test_secure_connection():
assert node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
assert node2.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
kThreadsNumber = 16
kIterations = 100
threads = []
for _ in range(kThreadsNumber):
threads.append(threading.Thread(target=(lambda:
[node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") for _ in range(kIterations)])))
for thread in threads:
thread.start()
for thread in threads:
thread.join()
finally:
cluster.shutdown()
unlink(docker_compose.name)