Commit e84c769
committed
Remove save-bump-restore from connect()
Reviewer feedback: the save-bump-restore in connect() mimics G5's
pattern but for the wrong reason. G5 bumps because it does an
unsolicited blocking read for the dashboard server's boot-up
message after TCPSocket::setup() — explicitly called out in the G5
source ("The first read after connection can take more time").
PolyScope X's connect() just issues an HTTP GET for /openapi.json
(~200 ms over VPN per maintainer measurement); no analogous
unsolicited read exists.
The original cursor-bot concern that motivated b1f900d was that the
1 s constructor read_timeout left openapi.json under-resourced
while in-tree callers raised the timeout only post-connect. That
concern was resolved by bumping the constructor default from 1 s to
10 s, which gives openapi.json the same headroom the example wrapper
applies manually. The save-bump-restore became dead weight: a no-op
for default callers, and it overrides explicit caller values shorter
than 10 s — paternalistic behavior the reviewer is rightly pushing
back on.
Drop the bump, the try/catch(...) rethrow guard, and the restore.
connect() returns to its pre-b1f900d shape (early returns from the
GET-and-parse pipeline). The recv_timeout_ storage stays because
commandPowerOn still uses it for its own per-call save-bump-restore,
which is a different and legitimate case (caller-supplied longer
deadline for an operation known to take longer).1 parent cdd9988 commit e84c769
1 file changed
Lines changed: 18 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
116 | 99 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 100 | + | |
122 | 101 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
139 | 113 | | |
140 | 114 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 115 | + | |
149 | 116 | | |
150 | 117 | | |
151 | 118 | | |
| |||
0 commit comments