Mqtt library (pubsubclient) loop freeze

I’m playing with ESP32, mqtt, PubSubClient library to send some data to server.
I have a problem with a very simple skecth that blink a led to check if there is a stop on loop:

#include <WiFi.h>
#include <PubSubClient.h>
boolean ledState;
unsigned long wait_verify_wifi = millis();
unsigned long wait_verify_mqtt = millis();

const char* ssid = "myssid";
const char* password = "mypassword";
const char* mqtt_server = "192.168.178.85";
const char* mqtt_username = "mqttuser";
const char* mqtt_password = "mqttpassword";

void callback(char* topic, byte* payload, unsigned int length) {
  // handle message arrived
}

WiFiClient espClient;
PubSubClient client(espClient);

long lastReconnectAttempt = 0;

boolean reconnect() {
  if (client.connect("ESP32_01", mqtt_username, mqtt_password)) {
    // Once connected, publish an announcement...
    client.publish("outTopic", "hello world");
    // ... and resubscribe
    client.subscribe("inTopic");
  }
  return client.connected();
}

void setup()
{
  Serial.begin(115200);
  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
  pinMode(4, OUTPUT);

  Serial.printf("Connecting to %s ...\n", ssid);
  WiFi.begin(ssid, password);
  delay(1500);
  Serial.print("Station connected, IP: ");
  Serial.println(WiFi.localIP());
  lastReconnectAttempt = 0;
}


void loop()
{
  if (!client.connected()) {
    long now = millis();
    if (now - lastReconnectAttempt > 10000) {
      lastReconnectAttempt = now;
      // Attempt to reconnect
      if (reconnect()) {
        lastReconnectAttempt = 0;
      }
    }
  } else {
    // Client connected

    client.loop();
  }
  digitalWrite(4, ledState);
  ledState = !ledState;
  delay(250);

  if (millis() - wait_verify_wifi > 5000) {
    wait_verify_wifi = millis();
    if (WiFi.status() != WL_CONNECTED) {
      Serial.println("WIFI NO CONNECTED");
    } else {
      Serial.println("WIFI CONNECTED");
    }
  }

    if (millis() - wait_verify_mqtt > 5000) {
    wait_verify_mqtt = millis();
    if (!client.connected()) {
      Serial.println("MQTT NO CONNECTED");
      Serial.println(client.state());
    } else {
      Serial.println("MQTT CONNECTED");
      
      Serial.println(client.state());
    }
  }
}

If I stop mqtt broker, the loop freeze. Led no blink.
Is there a way to don’t stop loop if connection with broker is down?
Can someone check if can reproduce the issue?

PubSubClient.connect() calls the connect() method of the provided WiFiClient with only two parameters, so no timeout is set. This means the call blocks indefinitely (on the ESP32 platform) if the server is not available.