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

Squash worker shutdown errors #38

Closed
clintonb opened this issue Apr 8, 2023 · 0 comments · Fixed by #40
Closed

Squash worker shutdown errors #38

clintonb opened this issue Apr 8, 2023 · 0 comments · Fixed by #40

Comments

@clintonb
Copy link
Contributor

clintonb commented Apr 8, 2023

I am migrating a service to use NestJS. The workers share a connection and client. Shutting down the service results in the error below. The client is most likely being shutdown before the worker. Admittedly, this is a problem of my own making; but, it would be ideal if this error were squashed and logged, rather than bubbling up.

[17:00:59.990] ERROR (49994): Error happened during shutdown
    context: "NestApplicationContext"
    err: {
      "type": "Error",
      "message": "Error happened during shutdown",
      "stack":
          IllegalStateError: Not running
              at Worker.shutdown (/Users/clintonb/vori/backend/node_modules/@temporalio/worker/src/worker.ts:755:13)
              at TemporalExplorer.onModuleDestroy (/Users/clintonb/vori/backend/node_modules/nestjs-temporal/dist/temporal.explorer.js:49:68)
              at MapIterator.iteratee (/Users/clintonb/vori/backend/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js:22:43)
              at MapIterator.next (/Users/clintonb/vori/backend/node_modules/iterare/src/map.ts:9:39)
              at IteratorWithOperators.next (/Users/clintonb/vori/backend/node_modules/iterare/src/iterate.ts:19:28)
              at Function.from (<anonymous>)
              at IteratorWithOperators.toArray (/Users/clintonb/vori/backend/node_modules/iterare/src/iterate.ts:227:22)
              at callOperator (/Users/clintonb/vori/backend/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js:23:10)
              at callModuleDestroyHook (/Users/clintonb/vori/backend/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js:43:23)
              at NestApplication.callDestroyHook (/Users/clintonb/vori/backend/node_modules/@nestjs/core/nest-application-context.js:234:53)
              at processTicksAndRejections (node:internal/process/task_queues:96:5)
              at async process.cleanup (/Users/clintonb/vori/backend/node_modules/@nestjs/core/nest-application-context.js:188:17)
    }

this.worker?.shutdown();

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 a pull request may close this issue.

1 participant