- Notifications
You must be signed in to change notification settings - Fork28
Commit4598a99
committed
Make get_controlfile not leak file descriptors
When backend functions were added to expose controldata via SQL,reading of pg_control was consolidated under src/common so thatboth frontend and backend could share the same code. That movefrom frontend-only to shared frontend-backend failed to recognizethe risk (and coding standards violation) of using a bare open().In particular, it risked leaking file descriptors if transienterrors occurred while reading the file. Fix that by usingOpenTransientFile() instead in the backend case, which ispurpose-built for this type of usage.Since there have been no complaints from the field, and an intermittentfailure low risk, no backpatch. Hard failure would of course be bad, butin that case these functions are probably the least of your worries.Author: Joe ConwayReviewed-By: Michael PaquierReported by: Michael PaquierDiscussion:https://postgr.es/m/20190227074728.GA15710@paquier.xyz1 parentf414abd commit4598a99
1 file changed
+10
-2
lines changedLines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 |
| |
31 | 34 |
| |
32 |
| - | |
| 35 | + | |
33 | 36 |
| |
34 | 37 |
| |
35 | 38 |
| |
| |||
51 | 54 |
| |
52 | 55 |
| |
53 | 56 |
| |
54 |
| - | |
55 | 57 |
| |
| 58 | + | |
56 | 59 |
| |
57 | 60 |
| |
58 | 61 |
| |
59 | 62 |
| |
60 | 63 |
| |
| 64 | + | |
61 | 65 |
| |
62 | 66 |
| |
63 | 67 |
| |
| |||
95 | 99 |
| |
96 | 100 |
| |
97 | 101 |
| |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 |
| |
| 106 | + | |
99 | 107 |
| |
100 | 108 |
| |
101 | 109 |
| |
|
0 commit comments
Comments
(0)