Commit 97e5f29
committed
Perform writes fully in event loop
`NettyConnection` is the abstraction over netty channel that allows us
to write RUN, PULL_ALL and other messages. Currently write consists of
two steps: (1) enqueue a response handler (2) perform actual write.
Step (1) is executed in the caller thread and step (2) is always
executed in the event loop thread (guaranteed by Netty).
Step (1) involves modification of a non-synchronized `LinkedList`
which is a problem. Later event loop thread will try to pop handlers
from the same list meaning we access it from different threads.
This commit make both (1) and (2) execute in the event loop to avoid
synchronization issues. It basically makes sure
`InboundMessageDispatcher` is only accessed by the event loop.
Also removed `ConcurrentSet` implementation in favour of the one
existing in Netty.1 parent d27f4f3 commit 97e5f29
File tree
8 files changed
+227
-111
lines changed- driver/src
- main/java/org/neo4j/driver/internal
- async
- pool
- util
- test/java/org/neo4j/driver
- internal/async
- v1/stress
8 files changed
+227
-111
lines changedLines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 124 | | |
127 | 125 | | |
128 | | - | |
| 126 | + | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
133 | 131 | | |
134 | | - | |
135 | | - | |
| 132 | + | |
| 133 | + | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 259 | + | |
| 260 | + | |
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
| |||
273 | 269 | | |
274 | 270 | | |
275 | 271 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 272 | + | |
| 273 | + | |
279 | 274 | | |
280 | 275 | | |
281 | 276 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 65 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
93 | | - | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
100 | 101 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 102 | + | |
108 | 103 | | |
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
112 | 107 | | |
113 | 108 | | |
114 | 109 | | |
115 | | - | |
| 110 | + | |
116 | 111 | | |
117 | 112 | | |
118 | 113 | | |
| |||
122 | 117 | | |
123 | 118 | | |
124 | 119 | | |
125 | | - | |
| 120 | + | |
126 | 121 | | |
127 | 122 | | |
128 | 123 | | |
| |||
137 | 132 | | |
138 | 133 | | |
139 | 134 | | |
140 | | - | |
| 135 | + | |
| 136 | + | |
141 | 137 | | |
142 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
143 | 184 | | |
144 | 185 | | |
145 | | - | |
| 186 | + | |
146 | 187 | | |
147 | 188 | | |
148 | 189 | | |
149 | | - | |
| 190 | + | |
150 | 191 | | |
151 | 192 | | |
152 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
153 | 200 | | |
154 | 201 | | |
155 | 202 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 0 additions & 71 deletions
This file was deleted.
0 commit comments