-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
app.startAllMicroservices hangs on bad connection to RMQ microservice #9749
Comments
maybe this is related with #9726 |
The problem happens because (for all servers) if the connection is not succeeded we never execute the callback on the nest/packages/microservices/server/server-rmq.ts Lines 83 to 98 in 79cccd0
So, this promise is never resolved and the server hangs I can work in a solution, @micalevisk don't know if you're already working on this :) In any case, we would need to decide if we should handle this error silently or not. The optimal way would be breaking the entire app an throwing an error? Or we should fail, logging an error, but without preventing the app from being launched? |
I've been pretty busy lately. PRs are more than welcomed 😺 |
@micalevisk do you think we should throw an error and stop the app execution? Or we should simply log the error and continue with the bootstrap of the application? In any case, I tried to add myself as assignee for this issue, but I don't have permissions for the repo. You can add me as assignee 😄 I'll fix this |
don't worry. We don't use that feat xD (I don't have permissions to) I guess we could log the error in v8, and raise it in v9 |
Let's track this here #9751 |
Is there an existing issue for this?
Current behavior
When building hybrid application, in my case its graphql + RMQ microservice, the bootstrapping is done the same way as in documentation
when there is no connection to RMQ - wrong host/username/password, the connection process is being stuck, without any error output.
From the code snippet above, the output is as follows:
And the process just hangs.
Minimum reproduction code
https://github.com/Turentkm/test-rmq-connection
Steps to reproduce
Expected behavior
Throw either operational error of end the process instead of eternal connections hanging.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
8.0.0
Packages versions
Node.js version
14.17.5
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: