Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not lose "testXReqId" when using "parallelLimit" #836

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Jan 29, 2024

No description provided.

@DudaGod DudaGod force-pushed the HERMIONE-1336.fix_empty_x_req_id branch from ee0ad97 to 6c277e6 Compare January 30, 2024 11:23
const pool = await makePool_({ limit: 1 });
await pool.getBrowser("bro", { some: "opt1" });
// should be called without await
Promise.delay(100).then(() => pool.freeBrowser(browser1));
Copy link
Member Author

Choose a reason for hiding this comment

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

Тут нельзя await юзать. При limit:1 следующий второй getBrowser просто зависает с неразрезолвленным промисом пока предыдущий не освободится. Поэтому я тут вызываю без await и через 100ms 1ый браузер освободится. Второй браузер к этому моменту уже запрошен. В итоге в этом случае код попадет в тот участок, который я исправил и в котором была ошибка.


this.log(`has queued requests for ${compositeId}`);
this.log(`remaining queue length: ${this._requestQueue.length}`);
this._newBrowser(queued.id, { version: queued.version }).then(queued.resolve, queued.reject);

this._newBrowser(queued.id, queued.opts).then(queued.resolve, queued.reject);
Copy link
Member Author

Choose a reason for hiding this comment

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

Проблема была в этой строке. Нужно было прокидывать все опции в которых летит state с testXReqId, а не только инфа о версии

@DudaGod DudaGod force-pushed the HERMIONE-1336.fix_empty_x_req_id branch from 6c277e6 to 9b0bf6c Compare January 30, 2024 11:29
@DudaGod DudaGod force-pushed the HERMIONE-1336.fix_empty_x_req_id branch from 9b0bf6c to 5496a5b Compare February 7, 2024 11:36
@DudaGod DudaGod merged commit 31e85fa into master Feb 7, 2024
2 checks passed
@DudaGod DudaGod deleted the HERMIONE-1336.fix_empty_x_req_id branch February 7, 2024 12:08
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