Skip to content
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

Support Meteor 3 #93

Open
wants to merge 336 commits into
base: master
Choose a base branch
from
Open

Support Meteor 3 #93

wants to merge 336 commits into from

Conversation

leonardoventurini
Copy link
Contributor

@leonardoventurini leonardoventurini commented Feb 3, 2023

Remove fibers from the agent and integrate with Async Hooks and Async Local Storage.

@leonardoventurini
Copy link
Contributor Author

Milestone

Tests pass on Meteor's future release 3.0 branch

image

@leonardoventurini
Copy link
Contributor Author

Right now there is no way to know if a promise has been awaited or resolved in the background. What we can do is assume that an event which does not have other events in parallel has been awaited.

lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/ntp.js Outdated Show resolved Hide resolved
@@ -81,12 +80,6 @@ SystemModel.prototype.buildPayload = function () {
metrics.mongoPoolCheckedOutConnections = driverMetrics.checkedOut;
metrics.mongoPoolCreatedConnections = driverMetrics.created;

const fiberMetrics = getFiberMetrics();
Copy link
Member

@zodern zodern Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be any async hooks/ALS metrics that would be useful instead? Can we track how many hooks or ASL stores are being used in the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can, will research.

lib/common/utils.js Outdated Show resolved Hide resolved
lib/common/utils.js Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
@StorytellerCZ
Copy link

Any new progress here?
Getting this when adding to 3.0-rc.7:

I20240712-14:29:12.372(2)? error on boot.js TypeError: Cannot read properties of undefined (reading 'prototype')
I20240712-14:29:12.372(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240712-14:29:12.372(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240712-14:29:12.372(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:53:5
I20240712-14:29:12.372(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240712-14:29:12.372(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240712-14:29:12.372(2)?     at /tools/static-assets/server/boot.js:453:5
I20240712-14:29:12.373(2)?     at /tools/static-assets/server/boot.js:504:7
I20240712-14:29:12.373(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)
I20240712-14:29:12.373(2)? TypeError: Cannot read properties of undefined (reading 'prototype')
I20240712-14:29:12.373(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240712-14:29:12.373(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240712-14:29:12.373(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:53:5
I20240712-14:29:12.373(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240712-14:29:12.373(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240712-14:29:12.373(2)?     at /tools/static-assets/server/boot.js:453:5
I20240712-14:29:12.373(2)?     at /tools/static-assets/server/boot.js:504:7
I20240712-14:29:12.373(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

@renanccastro
Copy link
Contributor

@StorytellerCZ it should work already. I will give it a shot with the latest RC, but it worked as far as rc.1.

@StorytellerCZ
Copy link

StorytellerCZ commented Jul 31, 2024

Got the following error when trying beta 5:

I20240731-19:41:18.179(2)? error on boot.js TypeError: Cannot read properties of undefined (reading 'prototype')
I20240731-19:41:18.179(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240731-19:41:18.180(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240731-19:41:18.180(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:58:5
I20240731-19:41:18.180(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240731-19:41:18.180(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240731-19:41:18.181(2)?     at /tools/static-assets/server/boot.js:453:5
I20240731-19:41:18.181(2)?     at /tools/static-assets/server/boot.js:504:7
I20240731-19:41:18.181(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)
I20240731-19:41:18.181(2)? TypeError: Cannot read properties of undefined (reading 'prototype')
I20240731-19:41:18.182(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240731-19:41:18.182(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240731-19:41:18.182(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:58:5
I20240731-19:41:18.182(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240731-19:41:18.182(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240731-19:41:18.182(2)?     at /tools/static-assets/server/boot.js:453:5
I20240731-19:41:18.182(2)?     at /tools/static-assets/server/boot.js:504:7
I20240731-19:41:18.183(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)

Initially couldn't even install because of this: meteor/meteor#13268

My packages:

meteor-base@1.5.2                 # Packages every Meteor app needs to have
mobile-experience@1.1.2           # Packages for a great mobile UX
mongo@2.0.0                       # The database Meteor supports right now
reactive-var@1.0.13                # Reactive variable for tracker
tracker@1.3.4                     # Meteor's client-side reactive programming library

standard-minifier-js@3.0.0        # JS minifier run for production mode
es5-shim@4.8.1                    # ECMAScript 5 compatibility for older browsers.
ecmascript@0.16.9                  # Enable ECMAScript2015+ syntax in app code
shell-server@0.6.0                # Server-side component of the `meteor shell` command

# testing

# development
percolate:migrations

# technical from Meteor
audit-argument-checks@1.0.8
force-ssl@1.1.1
check@1.4.2
session@1.2.2
reactive-dict@1.3.2
static-html@1.3.3
dynamic-import@0.7.4
react-meteor-data
ddp-rate-limiter@1.2.2
random@1.2.2
mdg:seo
fetch@0.1.5
url@1.3.3
logging@1.3.5
ejson@1.1.4
hot-module-replacement@0.5.4
dev-error-overlay@0.1.3
typescript@5.4.3
server-render@0.4.2
reload@1.3.2
email@3.0.0
react-fast-refresh@0.2.9

# GraphQL
apollo
swydo:graphql

# collections
aldeed:simple-schema
aldeed:collection2
aldeed:schema-deny

natestrauser:publish-performant-counts
reywood:publish-composite
matb33:collection-hooks@2.0.0-rc.2

# jam
jam:pub-sub
jam:offline

# socialize
socialize:base-model
socialize:commentable
socialize:friendships
socialize:likeable
socialize:linkable-model
socialize:messaging
socialize:postable
socialize:requestable
socialize:server-presence
socialize:server-time
socialize:user-blocking
socialize:user-model
socialize:user-presence
socialize:user-profile
socialize:feed
socialize:voteable

# accounts
accounts-2fa@3.0.0
service-configuration@1.3.5
accounts-password@3.0.0
accounts-facebook@1.3.4
accounts-twitter@1.5.1
accounts-google@1.4.1
oauth-encryption@1.3.3
bozhao:link-accounts
storyteller:accounts-line
accounts-meteor-developer@1.5.1
freedombase:legal-management
react-meteor-state
react-meteor-accounts
storyteller:accounts-discord
storyteller:accounts-betapass

# LU specific
storyteller:fictionaltime
freedombase:forums
lu-intl

# Financial packages
freedombase:payments-core
freedombase:payments-provider-stripe
freedombase:payments-subscriptions
freedombase:payments-platform
freedombase:payments-checkout

# other
alanning:roles@=4.0.0-rc.2
freedombase:flashnews
storyteller:ssl
zodern:types
storyteller:cdn
msavin:sjobs
ostrio:spiderable-middleware

montiapm:agent@=3.0.0-beta.5

@zodern
Copy link
Member

zodern commented Jul 31, 2024

Thanks @StorytellerCZ. I'll look into it this week.

@brianlukoff
Copy link

@zodern I'm seeing the same error as @StorytellerCZ when trying to use the 3.0 beta -- it seems to be a conflict with matb33:collection-hooks starting with version 2.0.0-rc.0 of that package -- if I revert matb33:collection-hooks back to 2.0.0-beta.2 then there is no problem.

@StorytellerCZ
Copy link

Collection hooks recently got a fix from MS core team on one thing, so it might be a good idea to test again.

@brianlukoff
Copy link

@StorytellerCZ I had tried with 2.0.0-rc.3 -- is that the latest? (I was just trying to figure out which version of collection-hooks introduced the incompatibility and it looks like it was rc.0.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants