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

Pair 1 Arranger Server instance with 1 Apollo Server instance #787

Open
evans-g-crsj opened this issue Apr 26, 2022 · 0 comments
Open

Pair 1 Arranger Server instance with 1 Apollo Server instance #787

evans-g-crsj opened this issue Apr 26, 2022 · 0 comments
Assignees
Labels
new-feature Request is a new feature

Comments

@evans-g-crsj
Copy link

It seems that for every Arranger project activated 1 apollo server is instantiated. Moreover, each apollo instance creates at least 2 SIGTERM listeners. Therefore, with as little as 5 projects the number of Event Emitters will exceed the default limit of 10 that node (strongly) suggests not to surpass. While not preventing us at all from using Arranger I believe it may influence some design decisions in a future major version.

Locally, here is the warning I get (I have 7 projects):

(node:204653) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
    at _addListener (node:events:465:17)
    at process.addListener (node:events:487:10)
    at ...omitted.../clin-arranger/node_modules/apollo-server-core/dist/ApolloServer.js:191:25
    at Array.forEach (<anonymous>)
    at new ApolloServerBase (...omitted.../clin-arranger/node_modules/apollo-server-core/dist/ApolloServer.js:175:21)
    at new ApolloServer (...omitted.../clin-arranger/node_modules/apollo-server-express/dist/ApolloServer.js:60:9)
    at _callee6$ (...omitted.../clin-arranger/node_modules/@arranger/server/dist/startProject.js:425:28)
    at tryCatch (...omitted.../clin-arranger/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (...omitted.../clin-arranger/node_modules/regenerator-runtime/runtime.js:294:22)
    at Generator.next (...omitted.../clin-arranger/node_modules/regenerator-runtime/runtime.js:119:21)
    at asyncGeneratorStep (...omitted.../clin-arranger/node_modules/@arranger/server/dist/startProject.js:47:103)
    at _next (...omitted.../clin-arranger/node_modules/@arranger/server/dist/startProject.js:49:194)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Detailed Description

It needs to be carefully thought of, but I would suggest to find a way to have one apollo server per arranger instance. It remains to be seen but it is probably better to have only one instance rather than multiple ones in the case of Apollo server. It would get rid of the warning that I consider a smell. And maybe (it is a big maybe) it would improve performance. If that's the case then every user would benefit from that change.

Possible Implementation

Allowing for multiple projects proves to be very useful in practice once in while. So Ideally, I would like that feature to stay but maybe it would be best to consider using one project only per arranger instance. If one needs more projects for a single app then multiple Arranger instances could be used. That way Arranger delegates the complexity to the client.

@evans-g-crsj evans-g-crsj added the new-feature Request is a new feature label Apr 26, 2022
@justincorrigible justincorrigible self-assigned this Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Request is a new feature
Projects
None yet
Development

No branches or pull requests

2 participants