node.js - EventEmitter Memory Leaked -
am using meteor. build meteor bundle helps in uploading files blob storage . getting next error. error occurs 1 time in 5 times.
w20141025-15:22:40.195(5.5)? (stderr) (node) warning: possible eventemitter memory leak detected. 11 listeners added. utilize emitter.setmaxlisteners() increment limit. w20141025-15:22:40.546(5.5)? (stderr) trace w20141025-15:22:40.546(5.5)? (stderr) @ addlistener (events.js:160:15) w20141025-15:22:40.546(5.5)? (stderr) @ /users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:399:31 w20141025-15:22:40.547(5.5)? (stderr) @ /users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:516:5 w20141025-15:22:40.547(5.5)? (stderr) @ sharedkey.signrequest (/users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/signing/sharedkey.js:81:3) w20141025-15:22:40.547(5.5)? (stderr) @ object.storageserviceclient._buildrequestoptions (/users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:498:27) w20141025-15:22:40.634(5.5)? (stderr) @ operation (/users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:255:10) w20141025-15:22:40.634(5.5)? (stderr) @ func [as _ontimeout] (/users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:422:11) w20141025-15:22:40.635(5.5)? (stderr) @ timer.listontimeout [as ontimeout] (timers.js:110:15)
the code here
azureupload:function(filename,accountname,key,container,callback) { var buffer = new buffer(this.data); retryoperations = new azure.exponentialretrypolicyfilter(); blobservice = azure.createblobservice(accountname, key).withfilter(retryoperations); var blockid = this.blockarray[this.blockarray.length-1]; var stream = new readablestreambuffer(buffer); var self = this; future = npm.require('fibers/future'); var myfuture = new future; blobservice.createblockfromstream(blockid,container,filename,stream,stream.size(),function(err,response) { if(err) { myfuture.return(); } else if (response) { if (self.bytesuploaded+self.data.length >= self.size) { blobservice.commitblocks(container, filename, {latestblocks: self.blockarray}, function(error, result){ if(error){ myfuture.return(); } else { myfuture.return({url:"https://"+accountname+".blob.core.windows.net/"+container+"/"+filename}); } }); } else { myfuture.return(); } } }); homecoming myfuture.wait(); }
you can view total source code here https://github.com/jamesfebin/azure-blob-upload/blob/master/azureupload.js (scroll downwards azureupload function)
node has default of 10 event emitters. can on loaded giving 15 concurrent request http server... can stopped setting process.setmaxlisteners(0). won't show errors.. refer more here http://nodejs.org/api/events.html
node.js azure meteor storage blob
No comments:
Post a Comment