Hi Meteorites,
after moving to Meteor 3 betas and then RCs, I started noticing some CPU spikes on my Users server with some very long running methods. For instance I could see in the server’s console messages such in the attached image (lines 2-4).
I then took some snapshots from APM and I can see multiple async functions running one after the other taking the total response time of the method to over 1 second as an average (which I don’t have a problem with) but many times it would take longer than that and the UX experience is affected. I request a code, I wait for an email and the email arrives after the 3 minutes set for the validity of the code. Also, as mentioned, processor spikes are visible in APM, something that I have never seen before in relation with the login process. Spikes are something like 20% on a small processor but which before would not exist.
Digging down into the Meteor repo, I think the problem starts here: meteor/packages/accounts-passwordless/server_utils.js at 22fbca50d1d96998b585cae585e0a97bbffa2665 · meteor/meteor · GitHub. Awaiting is missing.
I use a custom Passwordless package and after fixing this in my package, things look pretty good (but need more time to observe/evaluate). However, the total time of execution for those async functions remains the same. Perhaps will need to console.log some of the things happening in the Passwordless code generation process to be able to identify those "chained’ functions. The login part of the process, after the password/code is introduced, is managed by accounts-base package and that only takes a few milliseconds as always.
Anyone sees Passwordless issues? Well … if you use Passwordless and didn’t know you had this problem, you probably do have it. Would love to know about it.