Skip to content

Comments

feat: make Sessions exclusive for concurrent requests#3380

Draft
barjin wants to merge 5 commits intov4from
feat/session-pool-strategy
Draft

feat: make Sessions exclusive for concurrent requests#3380
barjin wants to merge 5 commits intov4from
feat/session-pool-strategy

Conversation

@barjin
Copy link
Member

@barjin barjin commented Feb 3, 2026

Multiple SessionPool.getSession() calls will now return different session instances, until SessionPool.reclaimSession(session) is called.

If more sessions than SessionPool.maxPoolSize are retrieved, SessionPool.getSession will return undefined.

Crawlers now expect this and will throttle based on the session availability.

Closes #3270

@barjin barjin self-assigned this Feb 3, 2026
@barjin barjin changed the title feat: SessionPool makes sessions usage exclusive for callers feat: SessionPool makes session usage exclusive for callers Feb 3, 2026

tryCancel();

const session = this.useSessionPool
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea - can we use the new ContextPipeline to inject the (exclusive) Session to the context - and unlock it in the cleanup? cc @janbuchar

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I believe so!

@barjin barjin changed the title feat: SessionPool makes session usage exclusive for callers feat: make Sessions exclusive for concurrent requests Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants