Commit 3f81019
committed
Split flush and writeBytes into separate branches
Fix two issues flagged by Copilot:
1. flush path was nested inside writeBytes branch and never executed for flush
2. Second CAS could fail when isReady()=false (same curState used twice)
New structure:
- flushAction: only set readyAndDrained=false if isReady()=false (original behavior)
- writeBytes: always set readyAndDrained=false (Tomcat fix)
Also renamed second test to match actual behavior:
writeBytes_isReadyBecomesFalse_isBuffered -> writeBytes_isReadyFalse_buffersUntilOnWritePossible
Fixed test to actually set isReady=false and verify second write is buffered.
Addressed Copilot comments on PR #127901 parent 1ef9eb8 commit 3f81019
2 files changed
Lines changed: 29 additions & 21 deletions
File tree
- servlet/src
- main/java/io/grpc/servlet
- test/java/io/grpc/servlet
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
236 | 228 | | |
237 | 229 | | |
238 | 230 | | |
239 | 231 | | |
240 | 232 | | |
241 | 233 | | |
242 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
Lines changed: 18 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
0 commit comments