Skip to content

Commit 0b97de3

Browse files
authored
Merge pull request #312 from meastham/meastham/fix_close_race
Fix connection_wrapper destructor sometimes closing other connections
2 parents ae670ba + a39625c commit 0b97de3

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

AUTHORS.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Contributors
22

33
4+
* Daniel Robbins [[email protected]](mailto:[email protected])
5+
* Lorenzo Mangani [[email protected]](mailto:[email protected])
6+
7+
8+
9+
* Michael Razuvaev [[email protected]](mailto:[email protected])
10+
11+
12+
* reema93jain [[email protected]](mailto:[email protected])
13+
* xinhuitian [[email protected]](mailto:[email protected])
14+
* Alex Bocharov [[email protected]](mailto:[email protected])
15+
416

517
To see the list of authors who created the source code of ClickHouse, published and distributed by ClickHouse, Inc. as the owner,
618
run "SELECT * FROM system.contributors;" query on any ClickHouse server.

programs/local/LocalChdb.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,12 @@ connection_wrapper::~connection_wrapper()
285285

286286
void connection_wrapper::close()
287287
{
288-
py::gil_scoped_release release;
289-
close_conn(conn);
288+
{
289+
py::gil_scoped_release release;
290+
close_conn(conn);
291+
}
292+
// Ensure that if a new connection is created before this object is destroyed that we don't try to close it.
293+
conn = nullptr;
290294
}
291295

292296
cursor_wrapper * connection_wrapper::cursor()

0 commit comments

Comments
 (0)