-
Notifications
You must be signed in to change notification settings - Fork 31
Add semaphore to block on puppeteer chromium execution #284
Add semaphore to block on puppeteer chromium execution #284
Conversation
Do we have the UT/IT to cover the change? |
Codecov Report
@@ Coverage Diff @@
## dev #284 +/- ##
==========================================
+ Coverage 74.94% 75.14% +0.19%
==========================================
Files 32 32
Lines 1764 1766 +2
Branches 342 345 +3
==========================================
+ Hits 1322 1327 +5
+ Misses 437 434 -3
Partials 5 5
Continue to review full report at Codecov.
|
kibana-reports/server/plugin.ts
Outdated
|
||
constructor(initializerContext: PluginInitializerContext) { | ||
this.logger = initializerContext.logger.get(); | ||
this.semaphore = withTimeout(new Semaphore(1), 30000, new Error('timeout')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 30 sec is too less a timeout. may be 180 seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 180 seconds
} else if (error.body.statusCode === 503) { | ||
handleErrorToast( | ||
'Error generating report.', | ||
`Timed out generating report ID ${reportId}. Try again later.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does 503 always because of timeout?
…r-elasticsearch#284) * Add mutex to lock on creating report using puppeteer * Use semaphore instead of mutex * change semaphore limit to 1 * Add 30 seconds timeout * Change timeout to 180 sec, add error message * Update error message * Add unit test for timeout error
…r-elasticsearch#284) * Add mutex to lock on creating report using puppeteer * Use semaphore instead of mutex * change semaphore limit to 1 * Add 30 seconds timeout * Change timeout to 180 sec, add error message * Update error message * Add unit test for timeout error
* Add mutex to lock on creating report using puppeteer * Use semaphore instead of mutex * change semaphore limit to 1 * Add 30 seconds timeout * Change timeout to 180 sec, add error message * Update error message * Add unit test for timeout error
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.