[SERVER-3481] interrupting --eval while(true){ ; } loops using killOp Created: 26/Jul/11  Updated: 08/Mar/13  Resolved: 07/Mar/13

Status: Closed
Project: Core Server
Component/s: JavaScript, Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Greg Studer Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.10, 6-core system, 16GB RAM.


Issue Links:
Duplicate
duplicates SERVER-7776 Review v8 preemption mechanism Closed
Related
is related to SERVER-4191 killOp cannot interrupt v8 javascript... Closed
Operating System: ALL
Participants:

 Description   

On my fast system (and infrequently on some buildbots), it takes a long time (potentially forever) to kill while(true){} spinlocks sent to the mongod server. This seems to especially occur when using v8, seems as if the kill operation just is not able to progress. Adding a sleep(1) statement to the while() loop fixes the problem.

While currently the problem only shows up in tests, potentially an accidentally buggy $where query may be unable to be terminated on a user's system while hogging the cpu.



 Comments   
Comment by Antoine Girbal [ 11/Nov/11 ]

greg, can you try this again with latest v8?
It should work better now.
Only possible issue is that empty loops can be optimized to have no stack guard, and v8 relies on that for interruption.

Generated at Thu Feb 08 03:03:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.