Skip to content

Commit e8641eb

Browse files
docs(api): clarify reuse/discard_all_idle pool config staleness
1 parent 4a4d82f commit e8641eb

4 files changed

Lines changed: 33 additions & 12 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 125
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-ebbe079bb2542625826422afd876a3e8b499c579cf45efc5fd50e7982d34df7d.yml
3-
openapi_spec_hash: db850b61a0d71fe9f4b642df8782d7ae
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-83323f87ab825547b6cd11caa46e2643ebb0a68bbd326d4e07ccab970638fc03.yml
3+
openapi_spec_hash: 69ed04a66b4ef68e97f7bdc07dfe6df2
44
config_hash: 06186eb40e0058a2a87ac251fc07415d

src/kernel/resources/browser_pools.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,12 @@ def update(
249249
Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
250250
https://chromeenterprise.google/policies/
251251
252-
discard_all_idle: Whether to discard all idle browsers and rebuild the pool immediately. Defaults
253-
to false.
252+
discard_all_idle: Whether to discard all idle browsers and rebuild them immediately with the new
253+
configuration. Defaults to false. Only browsers that are idle when the update
254+
runs are rebuilt. A browser that is in use during the update keeps its original
255+
configuration, and if it is later released with `reuse: true` it returns to the
256+
pool with that stale configuration until it is discarded (by this flag on a
257+
later update, or by flushing the pool).
254258
255259
extensions: List of browser extensions to load into the session. Provide each by id or name.
256260
@@ -554,7 +558,10 @@ def release(
554558
session_id: Browser session ID to release back to the pool
555559
556560
reuse: Whether to reuse the browser instance or destroy it and create a new one.
557-
Defaults to true.
561+
Defaults to true. A reused browser keeps the configuration it was created with,
562+
so it does not pick up pool configuration changes made while it was in use.
563+
Release with `reuse: false`, or flush the pool afterward, to rebuild it with the
564+
current configuration.
558565
559566
extra_headers: Send extra headers
560567
@@ -797,8 +804,12 @@ async def update(
797804
Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
798805
https://chromeenterprise.google/policies/
799806
800-
discard_all_idle: Whether to discard all idle browsers and rebuild the pool immediately. Defaults
801-
to false.
807+
discard_all_idle: Whether to discard all idle browsers and rebuild them immediately with the new
808+
configuration. Defaults to false. Only browsers that are idle when the update
809+
runs are rebuilt. A browser that is in use during the update keeps its original
810+
configuration, and if it is later released with `reuse: true` it returns to the
811+
pool with that stale configuration until it is discarded (by this flag on a
812+
later update, or by flushing the pool).
802813
803814
extensions: List of browser extensions to load into the session. Provide each by id or name.
804815
@@ -1102,7 +1113,10 @@ async def release(
11021113
session_id: Browser session ID to release back to the pool
11031114
11041115
reuse: Whether to reuse the browser instance or destroy it and create a new one.
1105-
Defaults to true.
1116+
Defaults to true. A reused browser keeps the configuration it was created with,
1117+
so it does not pick up pool configuration changes made while it was in use.
1118+
Release with `reuse: false`, or flush the pool afterward, to rebuild it with the
1119+
current configuration.
11061120
11071121
extra_headers: Send extra headers
11081122

src/kernel/types/browser_pool_release_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ class BrowserPoolReleaseParams(TypedDict, total=False):
1414
reuse: bool
1515
"""Whether to reuse the browser instance or destroy it and create a new one.
1616
17-
Defaults to true.
17+
Defaults to true. A reused browser keeps the configuration it was created with,
18+
so it does not pick up pool configuration changes made while it was in use.
19+
Release with `reuse: false`, or flush the pool afterward, to rebuild it with the
20+
current configuration.
1821
"""

src/kernel/types/browser_pool_update_params.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ class BrowserPoolUpdateParams(TypedDict, total=False):
2121
"""
2222

2323
discard_all_idle: bool
24-
"""Whether to discard all idle browsers and rebuild the pool immediately.
25-
26-
Defaults to false.
24+
"""
25+
Whether to discard all idle browsers and rebuild them immediately with the new
26+
configuration. Defaults to false. Only browsers that are idle when the update
27+
runs are rebuilt. A browser that is in use during the update keeps its original
28+
configuration, and if it is later released with `reuse: true` it returns to the
29+
pool with that stale configuration until it is discarded (by this flag on a
30+
later update, or by flushing the pool).
2731
"""
2832

2933
extensions: Iterable[BrowserExtension]

0 commit comments

Comments
 (0)