cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Shutdown Cluster in script if there is any failure

sahesh1320
New Contributor

I am working on incremental load from sql server to Delta lake tables stored in ADLS gen2. DUring the script i need to qrite a logic to

  • Shut down the DB cluster on failure (there needs to be logging added to ensure that shutdown happens promptly to prevent guardrail violations). 

What is the optimal way to achieve this?

1 REPLY 1

Wojciech_BUK
Valued Contributor III

If you run your notebook via workflow and error happen and there are no retires on job, then job cluster will be terminated immidietly after failure.

You can add python block of try catch and if error occurs , you catch the error and log somewhere before job will be terminated 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group