Timecap on execution of PAC script#8036
Conversation
matthiasblaesing
left a comment
There was a problem hiding this comment.
In general looks sane to me, but I left two inline comments. Please squash the commits into a single one.
71ff662 to
6ad47c1
Compare
naming changes few sanitations Changed default timeout and improved code Changes in initialisation of Request Processor
6ad47c1 to
35f11fb
Compare
|
@lahodaj I don't see a blocker for merging, so feel free to do so The common case is a thoughput of 1. |
Throughput 1 is common, and sometimes needed for correctness, but here probably not. There may be multiple URL connections initialized concurrently at the same time, and for each of them the PAC script may need to be evaluated. Currently (before this PR), there will be as many PAC script evaluations as there are connections, but we need to put the PAC script evaluation to a separate thread, so that it can be cancelled. If we used throughput 1, it would mean the URL connections initialization would be (more or less) sequential. It is not completely clear what is the ideal throughput, but I suspect it will turn out that there aren't so many concurrent URL connections initializations from the IDE, so the throughput does not matter so much. Overall, I suspect 1 might be too little. We could hardcode some other constant, but available processors does not look too bad. If the experience is bad, we can try to improve/fix. Note the throughput does not mean the threads are assigned only for this |
Issue
We need to restrict the PAC scripts with high cpu consumption that could lead to crash
Changes
Added time limit to PAC script execution.
Added a config in ProxySettings - pacScriptTimeout with default value set to 60 sec
Added tests for the same