You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
On my Windows configuration, pathwatcher starts taking up 100% CPU exhausting the node process. In the task manager it looks like the process of node is taking 99-100% CPU.
It doesn't happen on any set of observed files. I found a reproduction that consistently shows the problem on my machine (see the code below) and as I noticed, it is not a matter of a particular file path. It can be reproduced on my machine when observing a lot of files located in a non-trivial structure. At first it is all normal and pathwatcher observes file paths taking less than 1% of CPU. Later, when it reaches a specific point through the list of paths to observe, it gets node process to 100% CPU in less than a second.
Furthermore, investigating the size of g_events on every iteration of the loop seems to be 65, which is exactly one bigger than the maximum number of events the WaitForMultipleObjects call can wait on. I am not sure if it is related or not, because this happens even before node spikes to 100% CPU.
Windows 7 32-bit.
The code for a reproduction:
pathwatcher=require('pathwatcher')files=["C:\\Users\\IEUser\\meteor\\dev_bundle\\.bundle_version.txt","C:\\Users\\IEUser\\meteor\\packages\\underscore\\package.js","C:\\Users\\IEUser\\meteor\\packages\\underscore\\pre.js","C:\\Users\\IEUser\\meteor\\packages\\underscore\\underscore.js","C:\\Users\\IEUser\\meteor\\packages\\underscore\\post.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\package.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\server_environment.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\helpers.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\setimmediate.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\timers.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\errors.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\fiber_helpers.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\startup_server.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\debug.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\dynamics_nodejs.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\url_server.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\url_common.js","C:\\Users\\IEUser\\meteor\\packages\\meteor\\plugin\\basic-file-types.js","C:\\Users\\IEUser\\meteor\\packages\\json\\package.js","C:\\Users\\IEUser\\meteor\\packages\\base64\\package.js","C:\\Users\\IEUser\\meteor\\packages\\base64\\base64.js","C:\\Users\\IEUser\\meteor\\packages\\ejson\\package.js","C:\\Users\\IEUser\\meteor\\packages\\ejson\\ejson.js","C:\\Users\\IEUser\\meteor\\packages\\ejson\\stringify.js","C:\\Users\\IEUser\\meteor\\packages\\logging\\package.js","C:\\Users\\IEUser\\meteor\\packages\\logging\\.npm\\package\\npm-shrinkwrap.json","C:\\Users\\IEUser\\meteor\\packages\\logging\\logging.js","C:\\Users\\IEUser\\meteor\\packages\\routepolicy\\package.js","C:\\Users\\IEUser\\meteor\\packages\\routepolicy\\routepolicy.js","C:\\Users\\IEUser\\meteor\\packages\\tracker\\package.js","C:\\Users\\IEUser\\meteor\\packages\\tracker\\tracker.js","C:\\Users\\IEUser\\meteor\\packages\\tracker\\deprecated.js","C:\\Users\\IEUser\\meteor\\packages\\deps\\package.js","C:\\Users\\IEUser\\meteor\\packages\\htmljs\\package.js","C:\\Users\\IEUser\\meteor\\packages\\htmljs\\preamble.js","C:\\Users\\IEUser\\meteor\\packages\\htmljs\\visitors.js","C:\\Users\\IEUser\\meteor\\packages\\htmljs\\html.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\package.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\utils.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\scanner.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\charref.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\tokenize.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\templatetag.js","C:\\Users\\IEUser\\meteor\\packages\\html-tools\\parse.js","C:\\Users\\IEUser\\meteor\\packages\\blaze-tools\\package.js","C:\\Users\\IEUser\\meteor\\packages\\blaze-tools\\preamble.js","C:\\Users\\IEUser\\meteor\\packages\\blaze-tools\\tokens.js","C:\\Users\\IEUser\\meteor\\packages\\blaze-tools\\tojs.js","C:\\Users\\IEUser\\meteor\\packages\\minifiers\\package.js","C:\\Users\\IEUser\\meteor\\packages\\minifiers\\.npm\\package\\npm-shrinkwrap.json","C:\\Users\\IEUser\\meteor\\packages\\minifiers\\minification.js","C:\\Users\\IEUser\\meteor\\packages\\minifiers\\minifiers.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars-compiler\\package.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars-compiler\\templatetag.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars-compiler\\optimizer.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars-compiler\\codegen.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars-compiler\\compiler.js","C:\\Users\\IEUser\\meteor\\packages\\jquery\\package.js","C:\\Users\\IEUser\\meteor\\packages\\id-map\\package.js","C:\\Users\\IEUser\\meteor\\packages\\id-map\\id-map.js","C:\\Users\\IEUser\\meteor\\packages\\ordered-dict\\package.js","C:\\Users\\IEUser\\meteor\\packages\\ordered-dict\\ordered_dict.js","C:\\Users\\IEUser\\meteor\\packages\\random\\package.js","C:\\Users\\IEUser\\meteor\\packages\\random\\random.js","C:\\Users\\IEUser\\meteor\\packages\\random\\deprecated.js","C:\\Users\\IEUser\\meteor\\packages\\geojson-utils\\package.js","C:\\Users\\IEUser\\meteor\\packages\\geojson-utils\\pre.js","C:\\Users\\IEUser\\meteor\\packages\\geojson-utils\\geojson-utils.js","C:\\Users\\IEUser\\meteor\\packages\\geojson-utils\\post.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\package.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\minimongo.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\wrap_transform.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\helpers.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\selector.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\sort.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\projection.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\modify.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\diff.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\id_map.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\observe.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\objectid.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\selector_projection.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\selector_modifier.js","C:\\Users\\IEUser\\meteor\\packages\\minimongo\\sorter_projection.js","C:\\Users\\IEUser\\meteor\\packages\\observe-sequence\\package.js","C:\\Users\\IEUser\\meteor\\packages\\observe-sequence\\observe_sequence.js","C:\\Users\\IEUser\\meteor\\packages\\reactive-var\\package.js","C:\\Users\\IEUser\\meteor\\packages\\reactive-var\\reactive-var.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\package.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\preamble.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\exceptions.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\view.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\builtins.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\lookup.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\template.js","C:\\Users\\IEUser\\meteor\\packages\\blaze\\backcompat.js","C:\\Users\\IEUser\\meteor\\packages\\templating\\package.js","C:\\Users\\IEUser\\meteor\\packages\\templating\\plugin\\html_scanner.js","C:\\Users\\IEUser\\meteor\\packages\\templating\\plugin\\compile-templates.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars\\package.js","C:\\Users\\IEUser\\meteor\\packages\\spacebars\\spacebars-runtime.js","C:\\Users\\IEUser\\meteor\\packages\\ui\\package.js","C:\\Users\\IEUser\\meteor\\packages\\boilerplate-generator\\package.js","C:\\Users\\IEUser\\meteor\\packages\\boilerplate-generator\\boilerplate-generator.js","C:\\Users\\IEUser\\meteor\\packages\\boilerplate-generator\\boilerplate_web.browser.html","C:\\Users\\IEUser\\meteor\\packages\\boilerplate-generator\\boilerplate_web.cordova.html","C:\\Users\\IEUser\\meteor\\packages\\webapp-hashing\\package.js","C:\\Users\\IEUser\\meteor\\packages\\webapp-hashing\\webapp-hashing.js","C:\\Users\\IEUser\\meteor\\packages\\webapp\\package.js","C:\\Users\\IEUser\\meteor\\packages\\webapp\\.npm\\package\\npm-shrinkwrap.json","C:\\Users\\IEUser\\meteor\\packages\\webapp\\webapp_server.js","C:\\Users\\IEUser\\meteor\\packages\\check\\package.js","C:\\Users\\IEUser\\meteor\\packages\\check\\match.js","C:\\Users\\IEUser\\meteor\\packages\\retry\\package.js","C:\\Users\\IEUser\\meteor\\packages\\retry\\retry.js","C:\\Users\\IEUser\\meteor\\packages\\callback-hook\\package.js","C:\\Users\\IEUser\\meteor\\packages\\callback-hook\\hook.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\package.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\.npm\\package\\npm-shrinkwrap.json","C:\\Users\\IEUser\\meteor\\packages\\ddp\\common.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\stream_client_nodejs.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\stream_client_common.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\stream_server.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\heartbeat.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\livedata_server.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\writefence.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\crossbar.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\livedata_common.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\random_stream.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\livedata_connection.js","C:\\Users\\IEUser\\meteor\\packages\\ddp\\server_convenience.js","C:\\Users\\IEUser\\meteor\\packages\\session\\package.js","C:\\Users\\IEUser\\asdf\\.meteor\\release","C:\\Users\\IEUser\\asdf\\.meteor\\packages","C:\\Users\\IEUser\\asdf\\.meteor\\versions","C:\\Users\\IEUser\\asdf\\.meteor\\platforms","C:\\Users\\IEUser\\asdf\\.meteor","C:\\Users\\IEUser\\meteor\\packages\\accounts-base\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-facebook\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-github\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-google\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-meetup\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-meteor-developer\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-oauth-helper","C:\\Users\\IEUser\\meteor\\packages\\accounts-oauth\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-oauth1-helper","C:\\Users\\IEUser\\meteor\\packages\\accounts-oauth2-helper","C:\\Users\\IEUser\\meteor\\packages\\accounts-password\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-twitter\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-ui-unstyled\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-ui\\package.js","C:\\Users\\IEUser\\meteor\\packages\\accounts-weibo\\package.js","C:\\Users\\IEUser\\meteor\\packages\\appcache\\package.js","C:\\Users\\IEUser\\meteor\\packages\\application-configuration\\package.js","C:\\Users\\IEUser\\meteor\\packages\\audit-argument-checks\\package.js","C:\\Users\\IEUser\\meteor\\packages\\autopublish\\package.js","C:\\Users\\IEUser\\meteor\\packages\\autoupdate\\package.js","C:\\Users\\IEUser\\meteor\\packages\\binary-heap\\package.js","C:\\Users\\IEUser\\meteor\\packages\\browser-policy-common\\package.js"// this line causes issues!]for(variinfiles){varfilepath=files[i];pathwatcher.watch(filepath,function(){console.log('changed');});}
The text was updated successfully, but these errors were encountered:
On my Windows configuration, pathwatcher starts taking up 100% CPU exhausting the node process. In the task manager it looks like the process of node is taking 99-100% CPU.
It doesn't happen on any set of observed files. I found a reproduction that consistently shows the problem on my machine (see the code below) and as I noticed, it is not a matter of a particular file path. It can be reproduced on my machine when observing a lot of files located in a non-trivial structure. At first it is all normal and pathwatcher observes file paths taking less than 1% of CPU. Later, when it reaches a specific point through the list of paths to observe, it gets node process to 100% CPU in less than a second.
After adding a lot of logging, I found out that the call to
WaitForMultipleObjects
returns-1
(which means an error occurred) and the error code is87
, which meansERROR_INVALID_PARAMETER
.Furthermore, investigating the size of
g_events
on every iteration of the loop seems to be65
, which is exactly one bigger than the maximum number of events theWaitForMultipleObjects
call can wait on. I am not sure if it is related or not, because this happens even before node spikes to 100% CPU.Windows 7 32-bit.
The code for a reproduction:
The text was updated successfully, but these errors were encountered: