Commit db37e17
committed
fix(snapstart): disable idle pooling on the Lambda Runtime API client
register_extension_internal built its RAPID client with default pooling, so a
connection to the Runtime API could be parked in the idle pool and captured in a
SnapStart snapshot. That is the same hazard lambda_runtime handles by calling
reset_pool() on its own RAPID client during the restore lifecycle -- but nothing
resets or re-establishes this one, and register_default_extension terminates the
process with exit(1) when its request fails, so handing out a dead connection
after restore would kill the restored environment before it serves anything.
Pooling costs nothing to give up here: the client issues exactly two requests,
`register` and then the long poll for the first extension event, and the long
poll's in-flight connection is unaffected by the idle-pool setting. Disabled
unconditionally rather than gated on AWS_LAMBDA_INITIALIZATION_TYPE, since there
is no case where reuse helps.
Extracted as runtime_api_client so the property is testable; the test observes
connection lifetime (dropped vs parked), and I confirmed it fails against a
default-pooled client before the change.1 parent 928bc8c commit db37e17
1 file changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
879 | 898 | | |
880 | 899 | | |
881 | 900 | | |
| |||
1211 | 1230 | | |
1212 | 1231 | | |
1213 | 1232 | | |
1214 | | - | |
| 1233 | + | |
1215 | 1234 | | |
1216 | 1235 | | |
1217 | 1236 | | |
| |||
1821 | 1840 | | |
1822 | 1841 | | |
1823 | 1842 | | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
1824 | 1863 | | |
1825 | 1864 | | |
1826 | 1865 | | |
| |||
0 commit comments