forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit71d1ed6
committed
tests: Fix race condition in postmaster/002_connection_limits
The test occasionally failed due to unexpected connection limit errors beingencountered after having waited for FATAL errors on another connection. Thesespurious failures were caused by the the backend reporting FATAL errors to theclient before detaching from the PGPROC entry. Adding a sleep(1) beforeproc_exit() makes it easy to reproduce that problem.To fix the issue, add a helper function that waits for postmaster to noticethe process having exited. For now this is implemented by waiting for theDEBUG2 message that postmaster logs in that case. That's not the prettiestfix, but simple. If we notice this problem elsewhere, it might be worthwhileto make this more general, e.g. by adding an injection point.Reported-by: Tomas Vondra <tomas@vondra.me>Diagnosed-by: Heikki Linnakangas <hlinnaka@iki.fi>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Tested-by: Tomas Vondra <tomas@vondra.me>Discussion:https://postgr.es/m/ggflhkciwdyotpoie323chu2c2idpjk5qimrn462encwx2io7s@thmcxl7i6dpw1 parentd3fc7a5 commit71d1ed6
1 file changed
+32
-3
lines changedLines changed: 32 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
48 | 74 |
| |
49 | 75 |
| |
50 | 76 |
| |
51 | 77 |
| |
52 | 78 |
| |
53 | 79 |
| |
54 |
| - | |
| 80 | + | |
| 81 | + | |
55 | 82 |
| |
56 | 83 |
| |
57 | 84 |
| |
| |||
60 | 87 |
| |
61 | 88 |
| |
62 | 89 |
| |
63 |
| - | |
| 90 | + | |
| 91 | + | |
64 | 92 |
| |
65 | 93 |
| |
66 | 94 |
| |
67 | 95 |
| |
68 | 96 |
| |
69 | 97 |
| |
70 | 98 |
| |
71 |
| - | |
| 99 | + | |
| 100 | + | |
72 | 101 |
| |
73 | 102 |
| |
74 | 103 |
| |
|
0 commit comments
Comments
(0)