- Notifications
You must be signed in to change notification settings - Fork5
Commit387da18
committed
Use a nonblocking socket for FE/BE communication and block using latches.
This allows to introduce more elaborate handling of interrupts whilereading from a socket. Currently some interrupt handlers have to dosignificant work from inside signal handlers, and it's very hard tocorrectly write code to do so. Generic signal handler limitations,combined with the fact that we can't safely jump out of a signalhandler while reading from the client have prohibited implementationof features like timeouts for idle-in-transaction.Additionally we use the latch code to wait in a couple places where wepreviously only had waiting code on windows as other platforms justbusy looped.This can increase the number of systemcalls happening during FE/BEcommunication. Benchmarks so far indicate that the impact isn't veryhigh, and there's room for optimization in the latch code. The chanceof cleaning up the usage of latches gives us, seem to outweigh therisk of small performance regressions.This commit theoretically can't used without the next patch in theseries, as WaitLatchOrSocket is not defined to be fully signalsafe. As we already do that in some cases though, it seems better tokeep the commits separate, so they're easier to understand.Author: Andres FreundReviewed-By: Heikki Linnakangas1 parent778d498 commit387da18
3 files changed
+124
-46
lines changedLines changed: 32 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
| 75 | + | |
74 | 76 |
| |
75 | 77 |
| |
76 | 78 |
| |
| |||
338 | 340 |
| |
339 | 341 |
| |
340 | 342 |
| |
| 343 | + | |
341 | 344 |
| |
342 | 345 |
| |
343 | 346 |
| |
| |||
371 | 374 |
| |
372 | 375 |
| |
373 | 376 |
| |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
380 | 386 |
| |
381 | 387 |
| |
382 | 388 |
| |
| |||
504 | 510 |
| |
505 | 511 |
| |
506 | 512 |
| |
| 513 | + | |
507 | 514 |
| |
508 | 515 |
| |
509 | 516 |
| |
| |||
516 | 523 |
| |
517 | 524 |
| |
518 | 525 |
| |
| 526 | + | |
519 | 527 |
| |
520 | 528 |
| |
521 | 529 |
| |
522 | 530 |
| |
523 | 531 |
| |
524 | 532 |
| |
525 |
| - | |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
531 | 540 |
| |
532 | 541 |
| |
533 | 542 |
| |
| |||
567 | 576 |
| |
568 | 577 |
| |
569 | 578 |
| |
| 579 | + | |
570 | 580 |
| |
571 | 581 |
| |
572 | 582 |
| |
| |||
630 | 640 |
| |
631 | 641 |
| |
632 | 642 |
| |
633 |
| - | |
634 |
| - | |
635 |
| - | |
636 |
| - | |
637 |
| - | |
638 |
| - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
639 | 650 |
| |
640 | 651 |
| |
641 | 652 |
| |
| |||
722 | 733 |
| |
723 | 734 |
| |
724 | 735 |
| |
725 |
| - | |
| 736 | + | |
726 | 737 |
| |
727 | 738 |
| |
728 | 739 |
| |
| |||
741 | 752 |
| |
742 | 753 |
| |
743 | 754 |
| |
744 |
| - | |
| 755 | + | |
| 756 | + | |
745 | 757 |
| |
746 | 758 |
| |
747 | 759 |
| |
|
Lines changed: 76 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
35 | 36 |
| |
36 | 37 |
| |
| 38 | + | |
37 | 39 |
| |
38 | 40 |
| |
39 | 41 |
| |
| |||
147 | 149 |
| |
148 | 150 |
| |
149 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
150 | 160 |
| |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
151 | 185 |
| |
152 | 186 |
| |
153 | 187 |
| |
| |||
170 | 204 |
| |
171 | 205 |
| |
172 | 206 |
| |
| 207 | + | |
173 | 208 |
| |
| 209 | + | |
174 | 210 |
| |
175 | 211 |
| |
176 | 212 |
| |
177 | 213 |
| |
178 | 214 |
| |
179 | 215 |
| |
180 | 216 |
| |
181 |
| - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
182 | 257 |
|
Lines changed: 16 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
181 | 181 |
| |
182 | 182 |
| |
183 | 183 |
| |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
184 | 200 |
| |
185 | 201 |
| |
186 | 202 |
| |
| |||
820 | 836 |
| |
821 | 837 |
| |
822 | 838 |
| |
823 |
| - | |
824 |
| - | |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
829 |
| - | |
830 |
| - | |
831 |
| - | |
832 |
| - | |
833 |
| - | |
834 |
| - | |
835 |
| - | |
836 |
| - | |
837 |
| - | |
838 |
| - | |
839 |
| - | |
840 |
| - | |
841 |
| - | |
842 |
| - | |
843 |
| - | |
844 |
| - | |
845 |
| - | |
846 |
| - | |
847 |
| - | |
848 | 839 |
| |
849 | 840 |
| |
850 | 841 |
| |
|
0 commit comments
Comments
(0)