Repository navigation
Commit 847dce3
Client: open fan-out connections when a batch is dealt to them
scalar_function and table_in_out_function opened every connection the
init's max_workers allowed before dealing a single batch. Scalar and
table-in-out functions default to an unbounded max_workers, so the cap
was os.cpu_count(): on a 48-core box, a one-batch call opened 48
connections, 47 of them idle. On the subprocess transport that is 47
Python worker processes per call. Through the launcher it is 47 inits
queued on one shared worker.
_distribute_and_collect now opens a secondary connection the first
time a batch is dealt to it and sends its init on that connection's own
thread. The round-robin assignment is unchanged (batch i goes to
connection i % max_workers), so n batches use min(n, max_workers)
connections. table_function has no input to deal and still opens every
allowed connection at init.
The edge-case tests that allow four workers for fewer batches now also
assert how many secondary connections were opened.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 6fbffc0 commit 847dce3
5 files changed
Lines changed: 218 additions & 114 deletions
File tree
- tests
- scalar
- table_in_out
- vgi
- client
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
| |||
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
400 | 404 | | |
401 | 405 | | |
402 | 406 | | |
| |||
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
678 | | - | |
| 682 | + | |
679 | 683 | | |
680 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
681 | 688 | | |
682 | 689 | | |
683 | 690 | | |
| |||
704 | 711 | | |
705 | 712 | | |
706 | 713 | | |
707 | | - | |
| 714 | + | |
708 | 715 | | |
| 716 | + | |
709 | 717 | | |
710 | 718 | | |
711 | 719 | | |
| |||
715 | 723 | | |
716 | 724 | | |
717 | 725 | | |
718 | | - | |
| 726 | + | |
719 | 727 | | |
720 | 728 | | |
| 729 | + | |
721 | 730 | | |
722 | 731 | | |
723 | 732 | | |
724 | 733 | | |
725 | 734 | | |
726 | 735 | | |
727 | | - | |
| 736 | + | |
728 | 737 | | |
| 738 | + | |
729 | 739 | | |
730 | 740 | | |
731 | 741 | | |
| |||
737 | 747 | | |
738 | 748 | | |
739 | 749 | | |
| 750 | + | |
740 | 751 | | |
741 | 752 | | |
742 | 753 | | |
743 | 754 | | |
744 | 755 | | |
745 | 756 | | |
746 | 757 | | |
747 | | - | |
| 758 | + | |
748 | 759 | | |
| 760 | + | |
749 | 761 | | |
750 | 762 | | |
751 | 763 | | |
| |||
757 | 769 | | |
758 | 770 | | |
759 | 771 | | |
| 772 | + | |
| 773 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
149 | | - | |
| 155 | + | |
150 | 156 | | |
151 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
| |||
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
177 | | - | |
| 186 | + | |
178 | 187 | | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
187 | | - | |
| 197 | + | |
188 | 198 | | |
189 | 199 | | |
| 200 | + | |
190 | 201 | | |
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
196 | | - | |
| 207 | + | |
197 | 208 | | |
| 209 | + | |
198 | 210 | | |
199 | 211 | | |
200 | 212 | | |
| |||
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
| 220 | + | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
213 | 226 | | |
214 | 227 | | |
215 | | - | |
| 228 | + | |
216 | 229 | | |
| 230 | + | |
217 | 231 | | |
218 | 232 | | |
219 | 233 | | |
| |||
224 | 238 | | |
225 | 239 | | |
226 | 240 | | |
| 241 | + | |
| 242 | + | |
227 | 243 | | |
228 | 244 | | |
229 | 245 | | |
| |||
0 commit comments