This repository was archived by the owner on Oct 9, 2023. It is now read-only.
Commit 03a0340
authored
Remove calls to
## What is the goal of this PR?
We no longer call `close` on any of our gRPC Channels. This fixes
possible segfaults caused by resources being deallocated while they are
still in use.
## What are the changes implemented in this PR?
Users in a wide variety of scenarios had reported intermittent crashes,
often accompanied by warnings saying "1 metadata element(s) leaked". The
logs would look similar to the following:
```
7786| E1031 17:59:35.477338904 207 metadata.cc:253] WARNING: 1 metadata elements were leaked
7787| E1031 17:59:35.477409424 207 metadata.cc:260] mdelem ':authority' = 'typedb-cluster-1.typedb-cluster:1729'
7788| [mutex.cc : 435] RAW: Lock blocking 0x563cbf829fc0 @
7789| [mutex.cc : 1908] RAW: Check (v & (kMuWait | kMuWrWait)) != kMuWrWait failed: Lock: Mutex corrupt: waiting writer with no waiters: 0x563cbf815670
```
The same issue has also been reported in
googleads/google-ads-python#384, and a fix was
suggested in:
- grpc/grpc#19235
From this issue we infer that `Channel.close` is not behaving nicely in
gRPC Python, and can cause resources to be deallocated while they are
still in use. As gRPC itself uses native C libraries, this results in
segfaults and crashes. We determine that the best course of action is to
not close the Channel ourselves.
We've simply deleted the 3 places in our code that called `close` on a
gRPC `Channel`. It has passed our CI tests and fixed user-reported
issues, and it is what the gRPC maintainers themselves appear to
recommend in the linked `grpc` issue.
- closes #239
- see #265grpc.channel.close(), which could cause segfaults (#266)1 parent a850b2e commit 03a0340
File tree
7 files changed
+90
-136
lines changed- .factory
- typedb/connection
- cluster
- core
7 files changed
+90
-136
lines changedLines changed: 89 additions & 132 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
0 commit comments