IMD SolutionComputing LibraryShop main store

Troubleshooting

MQTTEngineCust thread count rising on an Ignition gateway

Edge computing and IIoT Published 8 min read By IMD Solution engineering team

Short answer

A single MQTTEngineCust thread waiting in LinkedBlockingQueue.take is an idle pool worker, not a leak. The decision comes from at least three full thread dumps taken during growth, comparing counts and thread IDs, with NULL JSON value log timestamps correlated before they are blamed. Capture first, escalate the evidence to the module vendor, and treat restarts only as observation boundaries.

On this page
  1. Is one WAITING MQTTEngineCust thread proof of a thread leak?
  2. How do I count MQTTEngineCust workers across thread dumps?
  3. Are the NULL JSON value log entries creating the threads?
  4. Which Ignition and MQTT Engine builds show the growth?
  5. What do I send the module vendor for rising MQTT threads?
  6. Does restarting MQTT Engine or the gateway fix it?
  7. What result confirms the fault is gone?
  8. Questions asked

A rising count of MQTTEngineCust threads on an Ignition gateway is decided by measurement, not by one alarming stack. The sample this article works from — thread MQTTEngineCust-45-f7d8386b, ID 481, WAITING under Java 17.0.10, with a stack ending in LinkedBlockingQueue.take and ThreadPoolExecutor.getTask — is an idle pool worker waiting for its next task, which by itself is normal. The fault is real only if that population keeps growing while old workers never exit. What follows is the dump series that separates a leak from healthy churn, what the NULL JSON value log lines do and do not prove, the builds the growth has been reported on, and the evidence package that gets the module vendor acting.

Is one WAITING MQTTEngineCust thread proof of a thread leak? #

No: a single worker in WAITING state whose stack ends in LinkedBlockingQueue.take and ThreadPoolExecutor.getTask is an idle executor thread waiting for its next queued task, and a leak shows only as a count that keeps rising across dumps.

Read the stack bottom-up. Thread.run drives ThreadPoolExecutor.runWorker, which loops on getTask; when the queue is empty, getTask blocks in LinkedBlockingQueue.take, suspending the thread through LockSupport.park and Unsafe.park on an AbstractQueuedSynchronizer condition. That is the normal idle position of a core pool thread: alive, holding a stack, using almost no CPU, and returning to work the moment a task is queued. A pool of such workers at a stable size is exactly what a healthy executor looks like in a snapshot.

The sample fits that picture: MQTTEngineCust-45-f7d8386b with ID 481 under Java 17.0.10 is one worker among many, and the numeric and hexadecimal suffixes in these names identify individual workers, not separate fault classes. Group them by the MQTTEngineCust prefix and judge the population, never a single member.

How do I count MQTTEngineCust workers across thread dumps? #

Take at least three full thread dumps while the count is rising, count every thread whose name begins with the MQTTEngineCust prefix in each dump, and record the numeric IDs so persistence can be separated from turnover.

  1. Capture full thread dumps from the gateway's Java process with the JDK's standard thread-dump tooling, not screenshots of a console thread listing; a screenshot hides IDs and truncates stacks.
  2. Schedule the captures inside the interval where your count visibly moves, and write the capture time next to each file.
  3. In each dump, count the threads whose name begins with MQTTEngineCust and list their numeric IDs.
  4. Build the set differences between consecutive dumps: which IDs appeared, which survived, which exited.
  5. Note the Ignition version, the MQTT module build and the Java runtime version at each capture, because a dump without its version pair is hard for support to use.

An illustrative run with invented counts: dumps at 09:00, 10:00 and 11:00 count 52, 67 and 81 workers. Growth is 67 − 52 = 15 workers in the first hour and 81 − 67 = 14 workers in the second, so 81 − 52 = 29 workers over 2 hours, a rate of 29 ÷ 2 = 14.5 workers per hour. All 52 IDs from the first dump are still present in the third, with 29 new IDs added and none retired: old workers never exit while new ones keep arriving, and accumulation at a steady rate is the leak signature. The contrast case is a third dump showing 54 workers with only 9 of the original IDs: the pool is churning through tasks and there is no leak to chase.

Decision: rising count plus persisting IDs, escalate with the package described below; flat count plus rotating IDs, the pool is normal and the instability lives elsewhere.

Are the NULL JSON value log entries creating the threads? #

Not proven: the log line confirms only that a null JSON value arrived on a device topic, and it becomes the cause only when its timestamps line up with worker creation across your dumps.

The line reports that the JSON value for a device uplink topic is NULL — a publisher sending a null field when it has nothing computed. Two things are true at once. First, null payloads are a legitimate suspect class: a public defect report on an open-source automation platform describes an MQTT binding that stopped receiving values after a null message, so the pattern has done real damage elsewhere. Second, suspicion is not measurement, and nothing in that log line shows that processing a null creates or retains a thread.

Context sharpens the suspicion without settling it: MQTT Engine is strict about JSON value types, and why a quoted MQTT JSON value fails an analog point shows how one bad value type propagates into tags, while why MQTT Transmission publishes null DDATA on bad quality shows null has a documented life of its own on the outbound side. Neither page proves anything about worker threads; both say the null path is worth correlating, not assuming.

Run the correlation against the illustrative run above. The same two hours produced 43 NULL value lines, and a one-worker-per-null mechanism would predict 43 new workers where the dumps measured 29. Worse for the theory, 31 of those nulls fall in two bursts of a few minutes each, while the growth is near-linear at 15 then 14 workers in successive hours — a bursty cause cannot produce a linear effect. Decision: fix the nulls at the publisher regardless, because a null payload is bad data even when it is not the leak, but do not label it the cause; hand the vendor both timestamp series and let the dumps carry the argument.

Which Ignition and MQTT Engine builds show the growth? #

Growth is reported on module builds 4.0.21, 4.0.26 (b2025011422) and 4.0.28 (b2025033119) under Ignition 8.1.41, 8.1.45 and 8.1.47, while no threading issues are known in 4.0.31, the newest build listed on the module download page.

Ignition MQTT Engine build Broker Reported behavior
8.1.41 4.0.21 the vendor's MQTT Distributor worker count rising; survived the upgrade and restarts
8.1.45 4.0.26 (b2025011422) a standalone third-party broker constant growth in a second environment
8.1.47 4.0.28 (b2025033119) a standalone third-party broker constant growth in that same environment
not reported 4.0.31 not reported no known threading issues

The reports span two broker platforms and three module builds, which does not prove one shared defect and does not define an affected range; equally, no known issues is the absence of reports, not a guaranteed fix. Decision: capture your evidence on the build you run now, so the fault is documented where it exists, then move to 4.0.31 and keep the identical dump schedule. A count that stays flat after the upgrade closes the incident; a count that keeps rising on the newest build turns your dumps into a case the vendor cannot defer.

What do I send the module vendor for rising MQTT threads? #

Send every full thread dump, the full gateway logs covering the same interval, and a version sheet with each capture: that package lets the module vendor trace the worker lifecycle, where a restart history tells them nothing.

  • All full thread dumps with their capture timestamps, including any taken after a restart.
  • The full gateway logs for the same window, with the NULL value lines, their timestamps and their device topics left intact — do not clean the logs before sending.
  • A version sheet per capture: Ignition version, MQTT module build exactly as the gateway shows it (for example 4.0.26 (b2025011422)), Java runtime version (17.0.10 in the sample stack), and the broker type.
  • Your count-per-dump table with the ID set differences, so support sees the accumulation at a glance.
  • The restart observations: which restart (module only or whole gateway) moved the count, and how fast growth rebuilt afterward.

Ask two questions explicitly: what creates a MQTTEngineCust worker, and under what condition does one exit. Public issue trackers for other Java MQTT clients show the two classic failure shapes — workers held while a client session persists (a HiveMQ client issue numbered 633) and threads left waiting forever on delivery tokens of deleted messages (a Paho Java issue numbered 453) — and the vendor must rule both in or out for its own client.

Does restarting MQTT Engine or the gateway fix it? #

A restart resets the count and destroys the evidence, so use it only as an observation boundary: capture a dump first, restart, then resume counting to measure how fast the growth rebuilds under unchanged traffic.

In the environment that first reported this, the growth came back after both a module restart and an Ignition upgrade, so restarts did not resolve it — and each restart without a prior dump erased another piece of the pattern. The rate measured after a restart is still useful: growth that rebuilds at the same workers-per-hour figure points at message traffic as the driver, while growth that appears only after long uptime points at a slower lifecycle leak. The capture-first discipline is the same one that turns restart cycles into diagnoses when an industrial runtime leaks memory instead of threads, as in memory growth and restart troubleshooting on an industrial PC runtime.

What result confirms the fault is gone? #

The fault is closed when the worker count stays flat across the same dump cadence that previously showed growth, with gateway stability holding under the same message traffic.

Judge it with the arithmetic that exposed it: where the illustrative run added 15 then 14 workers in successive hours, a fixed gateway moves by no more than a worker or two between dumps, and old IDs actually disappear as the pool shrinks back after traffic bursts. Keep the cadence running for at least as long as the growth originally took to become visible before you call it closed. If the count resumes climbing after a module upgrade, reopen the case with the new dumps appended — the evidence file only gets stronger.

Questions asked

Why does the stack show Unsafe.park instead of a blocked lock?

Unsafe.park is the JVM's native way to suspend a thread until it is unparked, and a thread parked on a queue condition is waiting for work, not fighting over a lock. A real deadlock looks different: threads BLOCKED on the same monitor, which the JVM's deadlock detection prints at the top of the dump. If that section is absent, your WAITING workers are idle, not deadlocked.

Will giving the gateway more heap fix the instability?

No. Each Java thread reserves its own stack outside the configured heap, so a population that keeps growing eats memory the heap setting never governs and ends in an unable-to-create-native-thread error rather than a heap outage. A bigger heap only buys time; the fixes are stopping the growth or changing the worker lifecycle with the module vendor's help.

How far apart should the thread dumps be spaced?

Far enough apart that the count visibly moves between captures. With fast growth, roughly an hour apart shows the trend inside one shift; with slow growth, spread the captures across a day or more. What matters is that every dump lands while the count is still rising, and that the capture time, Ignition version and module build are noted beside each file.

Should I silence the device that publishes the null values?

Yes, as a controlled test, not as the fix. Quiet that one publisher, keep the dump cadence unchanged, and compare: growth that continues with the nulls gone clears the null payload as the mechanism, while growth that stops makes the correlation the vendor needs to see. Keep the original logs either way, because the silenced publisher explains why the NULL lines stop appearing.

What if the worker count is flat but the gateway is still unstable?

Then the threads are not your instability. A stable worker population with crashes, pauses or memory pressure points elsewhere: record heap usage and garbage-collection activity, CPU per process, and the gateway log lines around each instability event, and chase those measurements before reopening the thread question.

Keep reading

  • Troubleshooting

    Trace Ignition Edge MQTT values that only update on refresh

    Values that appear only after a refresh mean the Edge transmitter publishes nothing on its own: the forced republish masks a stalled change-driven path. Set a 10,000 ms scan rate with a 0.00000001 deadband and a moving signal publishes at the scan rate, then verify by counting 6 updates per minute with no refresh anywhere. Trace tag value and timestamp at each hop to find where it stops.

    Edge computing and IIoT

  • Troubleshooting

    Why a group of MQTT tags goes stagnant in Ignition

    Groups of tags can freeze between an Ignition MQTT edge node and the cloud server while the connection stays up, then recover on their own after hours. No fixed version is proven: an in-place module upgrade above 4.0.6 reproduced the same behavior during an active incident, so capture evidence while it happens and monitor past the 29-day recurrence.

    Edge computing and IIoT

  • Troubleshooting

    MQTT Engine server definition not found: the typographic quote cause

    When MQTT Engine logs no server definition found, check the startup log for a JsonParseException: a General-tab JSON value opened its field name with a typographic quote, so module startup failed before connection objects were built. Retype the value with plain quotes and restart; the brokers, the firewall and the installation were never at fault.

    Edge computing and IIoT

What an edge gateway spec sheet tells you before deployment