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:ย 

Code on cluster runs idefinitely

darek554
New Contributor

Hello.

Ive created a custom cluster - m4.large. When i try to execute some code in this cluster the behaviour is as follows:

- Cluster starts, have running status

- I run code, for example print("Hello")

- Code runs indefinitely

- I click interrupt, it stops after long time

- When code is stopped, next code execution runs fine

But this is about python, SQL dont run at all, even SELECT 1; query.

Can someone tell me what can be an issue?

1 REPLY 1

Yogasathyandrun
New Contributor II

The fact that print("Hello") eventually works but SELECT 1 never completes suggests the cluster may be running but not fully initialized for Spark workloads.

A few things Iโ€™d check first:

  • Cluster Event Log for any provisioning or startup errors.
  • Spark UI โ†’ Executors to confirm workers/executors are actually coming up.
  • Driver logs for startup exceptions or connectivity issues.
  • Whether this is a single-node cluster or a cluster with separate workers.

One other thing that stands out is the use of m4.large, which is a fairly old instance family. If possible, try spinning up a small cluster on a newer instance type (for example m5 or m6 generation) and see if the behavior changes.

Also, which Databricks Runtime version are you running, and does the issue occur immediately after cluster startup or only after the cluster has been idle for some time?

Data Engineer | Apache Spark | Delta Lake | Databricks