-
Notifications
You must be signed in to change notification settings - Fork 26
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
Element cannot be closed / shutdown cleanly #420
Comments
I got the same issues when implement on azure database ledger since the connection of the database is still open and there is no method from the did method core to close the connection or terminate the ledger for the shutdown method |
yes, I have struggled to exit the processes cleanly... perhaps explicit |
can you link to your source? |
In the Azure SQL database ledger implement, I can close the database connection after the test script https://github.com/sekuid/sidetree.js/blob/main/packages/ledger-ms-sqldb/src/__tests__/AzureSqlDbLedger.test.ts However, in the did method , I could not do it as there is no method to terminate the ledger properly as the database connection pool is still open. This is not an issue with the actual system as the backend service is support to reuse the connection from the connection pool. However, it will cause an issue during testing or shutting down the system. Note: The did-method-atom is used Azure SQL database with ledger enabled (the test will use Ms SQL Server 2022) and Azure storage as the Content address storage (test will used azurite as a storage emulator) https://github.com/sekuid/sidetree.js/blob/main/docker-compose.yml |
So i am hearing we ned to expose a shutdown handler from the did method core package, is that right? Something in here: https://github.com/transmute-industries/sidetree.js/blob/main/packages/did-method/src/Core.ts#L162 |
Yes, any function in the IBlockchain interface to terminate/shutdown the ledger e.g
|
In order for jest to exit properly, element needs to close all its activity properly.
This is not happening leading to the default jest warning:
The text was updated successfully, but these errors were encountered: