Commit e44bd04
[fix] Avoid a data race when flushing with load (#1261)
Fixes #1258
### Motivation
While flushing, the data channel is switched if a new allocated one which can cause the loss of messages because the length can be zero which would stop the procedure and at the same time a new message can be sent to the channel.
### Modifications
Instead of allocating a new channel, it empties the existing one up to the length of the buffer of the channel before proceeding with the flush.
(cherry picked from commit 8dd4ed1)1 parent 53fc938 commit e44bd04
1 file changed
Lines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | 341 | | |
346 | 342 | | |
347 | 343 | | |
| |||
1022 | 1018 | | |
1023 | 1019 | | |
1024 | 1020 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
| 1021 | + | |
1034 | 1022 | | |
1035 | 1023 | | |
1036 | 1024 | | |
| |||
1061 | 1049 | | |
1062 | 1050 | | |
1063 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1064 | 1071 | | |
1065 | 1072 | | |
1066 | 1073 | | |
| |||
0 commit comments