-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible EventEmitter memory leak warning #2122
Comments
We've had this warning appear for awhile, so it's nothing new. @kumavis was any of your filter work related to listeners? |
Probably worth asking: what console are you seeing this warning in? If it's the web page console, that might actually be new. |
We are managing event subscriptions differently now, so it's very possible these new warnings are not actual problems, but we'll revisit them, because we should stay quiet if nothing is wrong, especially in the Ðapp's console. |
|
Well that makes it sound much more serious. I just left my computer for a few hours, but we'll be looking at this asap. |
@FlySwatter Thanks for the quick response--- very appreciated. I'm seeing this in the chrome console. FWIW, after this change, I'm no longer able to read events off of my locally deployed smart contracts. |
For me it's a breaking change. My DApp no longer handles event logs properly without any changes to my code. |
@VogtAI What were the changes you had to make? |
@vincentchu I phrased it poorly. I meant to say that I didn't change anything in my code, so I'm sure the MetaMask update broke my DApp. |
Might be related - My MetaMask stopped working all of the sudden today. It crashes right away when I click on the icon. I can confirm that after downgrading to 3.10.0, MetaMask works again. This happens for me only on google chrome canary. works fine in regular chrome browser. Looking at the error logs I see a bunch of the EventEmitter warnings you described. |
@vincentchu, @VogtAI, ❗ same thing happened to me. Event fetching is now broken in my DApp. Edit: my setup is running with testrpc on http://localhost:8545, event fetch is of the form |
We've re-published 3.10.0 as 3.10.2, so your users should have the hot fix soon. |
We'll be looking closely at the changes and fixing the issue before republishing. |
We believe we have fixed this issue, could affected developers test this custom build against your dapps, and confirm this fixes this problem? |
3.10.3-pre gives me the same issue BTW, had to remove -pre from the version in manifest.json to manually install it in Chrome |
@adklempner Could you provide us with reproduction steps? We fixed the issue we were able to reproduce, now we're not so sure. |
Updated version that fixes the problem @adklempner noted: |
Thanks for the quick turn around. Unfortunately, no luck with 3.10.3-pre2 for me.
window.onload = function () {
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
}
var abi = [{ "inputs": [], "payable": false, "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "x", "type": "uint256" } ], "name": "Foobar", "type": "event" } ];
var address = "0x42fdca8935689fcdf2baedc707de6da978515564";
var TestContract = web3.eth.contract(abi);
var testInstance = TestContract.at(address);
var foobarEvent = testInstance.Foobar(null, {fromBlock: 0, toBlock: 'latest'}, function (error, result) {
if (error)
console.error(error)
else
console.log("Got a foobar with " + result.args.x.toString());
});
}
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<script src="web3.min.js"></script>
<script src="app.js"></script>
</body>
</html>
Result (expected) with 3.10.0:
Result with 3.10.3-pre2:
Chromium version: testrpc version: |
EDITFOUND SOLUTION TO MY PROBLEM HERE: Original commentI'm not sure if it's been fixed. I get the same error, just the number changed from 11 to 101. I think working with 101 contracts at once in dapp is not something unusual.
It's coming from Contract constructor, then packageInit and source seems to be setProvider:
that is called from packageInit:
that is called from Contract constructor:
This means setProvider is called for each contract constructed? If yes, then it means it's not possible to call |
It is - it just warns you about a possible memory leak. |
Was developing all weekend with MetaMask and I can swear that this warning never popped up until just today:
contentscript.js:2532 (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
When seeing this issue, events no longer were syncing between my local testnet and Metamask
Wonder if this had anything with the new release that went out 9/18/2017?
I searched in the current issues and only old issues were found but I wonder if they're related somehow?
Thanks ...
The text was updated successfully, but these errors were encountered: