forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb8ba734
committed
Fix handling of errors in libpq pipelines
The logic to keep the libpq command queue in sync with queries that havebeen processed had a bug when errors were returned for reasons otherthan problems in queries -- for example, when a connection is lost. Weincorrectly consumed an element from the command queue every time, butthis is wrong and can lead to the queue becoming empty ahead of time,leading to later malfunction: PQgetResult would return nothing,potentially causing the calling application to enter a busy loop.Fix by making the SYNC queue element a barrier that can only be consumedwhen a SYNC message is received.Backpatch to 14.Reported by: Иван Трофимов (Ivan Trofimov) <i.trofimow@yandex.ru>Discussion:https://postgr.es/m/17948-fcace7557e449957@postgresql.org1 parent63c5df1 commitb8ba734
3 files changed
+40
-25
lines changedLines changed: 36 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2112 | 2112 |
| |
2113 | 2113 |
| |
2114 | 2114 |
| |
2115 |
| - | |
2116 |
| - | |
2117 |
| - | |
2118 |
| - | |
2119 |
| - | |
2120 |
| - | |
2121 |
| - | |
2122 |
| - | |
2123 |
| - | |
2124 |
| - | |
2125 |
| - | |
2126 |
| - | |
2127 | 2115 |
| |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
2128 | 2121 |
| |
2129 | 2122 |
| |
2130 | 2123 |
| |
| |||
3088 | 3081 |
| |
3089 | 3082 |
| |
3090 | 3083 |
| |
3091 |
| - | |
3092 |
| - | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
3093 | 3099 |
| |
3094 | 3100 |
| |
3095 |
| - | |
| 3101 | + | |
3096 | 3102 |
| |
3097 | 3103 |
| |
3098 | 3104 |
| |
3099 | 3105 |
| |
3100 | 3106 |
| |
3101 | 3107 |
| |
3102 |
| - | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
3103 | 3122 |
| |
3104 | 3123 |
| |
3105 | 3124 |
| |
3106 | 3125 |
| |
3107 | 3126 |
| |
3108 | 3127 |
| |
3109 | 3128 |
| |
3110 |
| - | |
| 3129 | + | |
3111 | 3130 |
| |
3112 | 3131 |
| |
3113 | 3132 |
| |
|
Lines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
| 243 | + | |
| 244 | + | |
250 | 245 |
| |
251 | 246 |
| |
252 | 247 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
698 | 698 |
| |
699 | 699 |
| |
700 | 700 |
| |
701 |
| - | |
| 701 | + | |
| 702 | + | |
702 | 703 |
| |
703 | 704 |
| |
704 | 705 |
| |
|
0 commit comments
Comments
(0)