forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8b0b630
committed
Try to ensure that stats collector's receive buffer size is at least 100KB.
Since commit4e37b3e, buildfarm member frogmouth has been failingoccasionally with symptoms indicating that some expected stats data isgetting dropped. The reason that that commit changed the behavior seemsprobably to be that more data is getting shoved at the collector in a shortspan of time. In current sources, the stats test's first session sendsabout 9KB of data while exiting, which is probably the same as what wassent just before wait_for_stats() in the previous test design. But now,the test's second session is starting up concurrently, and it sends another2KB (presumably reflecting its initial catalog accesses). Since frogmouthis running on Windows XP, which reputedly has a default socket receivebuffer size of only 8KB, it is not very surprising if this has put us overthe threshold where the receive buffer can overflow and drop messages.The same mechanism could very easily explain the intermittent stats testfailures we've been seeing for years, since background processes suchas the bgwriter will sometimes send data concurrently with all this, andcould thus cause occasional buffer overflows.Hence, insert some code into pgstat_init() to increase the stats socket'sreceive buffer size to 100KB if it's less than that. (On failure, emit aLOG message, but keep going.) Modern systems seem to have default sizesin the range of 100KB-250KB, but older platforms don't. I couldn't findany platforms that wouldn't accept 100KB, so in theory this won't causeany portability problems.If this is successful at reducing the buildfarm failure rate in HEAD,we should back-patch it, because it's certain that similar buffer overflowshappen in the field on platforms with small buffer sizes. Going forward,there might be an argument for trying to increase the buffer size evenmore, but let's take a baby step first.Discussion:https://postgr.es/m/22173.1494788088@sss.pgh.pa.us1 parent59f4056 commit8b0b630
1 file changed
+32
-0
lines changedLines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 |
| |
97 | 100 |
| |
98 | 101 |
| |
| |||
574 | 577 |
| |
575 | 578 |
| |
576 | 579 |
| |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
577 | 609 |
| |
578 | 610 |
| |
579 | 611 |
| |
|
0 commit comments
Comments
(0)