Commit d3e0ca7
committed
crimson/mgr/client:Introduce Client::send()
Client::reconnect nullifies the connection used by the mgr client
before setting a new one.
In this time, we might re-use the nullptr connection due to tasks
that are being run in the background (See: dispatch_in_background).
To avoid this, we had multiple `if (!conn)` checks, some methods
even checked this condition twice to reduce the possibilty of using
undefined the connection.
Instead of introducing an additional check in Client::_send_report,
Introduce Client::send which would be responsible for:
a) Veryfing the connection is set
b) Trying to get a shared access to conn_lock
Client::reconnect will lock conn_lock exclusivly until the
connection is set. If we send is called while reconnecting,
sending will be dropped - same as before.
Fixes: https://tracker.ceph.com/issues/70179
Signed-off-by: Matan Breizman <[email protected]>1 parent 6e23a1e commit d3e0ca7
2 files changed
+32
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
54 | 74 | | |
55 | 75 | | |
56 | 76 | | |
| |||
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
92 | | - | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| |||
117 | 137 | | |
118 | 138 | | |
119 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
120 | 144 | | |
121 | 145 | | |
122 | 146 | | |
| |||
185 | 209 | | |
186 | 210 | | |
187 | 211 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 212 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 213 | + | |
| 214 | + | |
199 | 215 | | |
200 | 216 | | |
201 | 217 | | |
| |||
211 | 227 | | |
212 | 228 | | |
213 | 229 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
235 | 247 | | |
236 | 248 | | |
237 | 249 | | |
238 | | - | |
| 250 | + | |
239 | 251 | | |
240 | 252 | | |
241 | | - | |
| 253 | + | |
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
0 commit comments