nathanmarz/storm · error · RuntimeException

Error during multilang processing

Error message

Error during multilang processing

What it means

ShellBolt.execute places the incoming tuple as a JSON task on the write queue consumed by the subprocess writer thread. If _pendingWrites.put blocks and the thread is interrupted, it throws this RuntimeException. It indicates the bolt's executor thread was interrupted while waiting to hand a tuple to the multilang process, usually because the bolt is shutting down or the writer thread died.

Solutions

  1. Check whether the subprocess is alive and consuming output — restart the topology/worker if the process hung; ensure the script reads stdin continuously and never blocks long
  2. Look at worker logs for preceding subprocess death or ShellBolt reader-thread errors and fix the root cause (script crash, OOM)
  3. If this occurs only during rebalance/kill, it is expected interruption — ensure your script handles SIGTERM and exits promptly
  4. Make the bolt idempotent/able to reprocess tuples, since tuples pending at interruption are failed and replayed by the spout
Defensive patterns

Strategy: try-catch

Try / catch

// in a wrapper around ShellBolt.execute or a delegating bolt:
try {
    shellBolt.execute(input);
} catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().contains("Error during multilang processing")) {
        LOG.warn("Multilang write queue interrupted; tuple will be replayed", e);
        // do not ack; allow storm to fail/replay the tuple
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: The bounded _pendingWrites queue is full (subprocess is slow or dead) so put() blocks, and the executor thread gets interrupted (topology shutdown, worker restart, orsuicide of the writer thread after subprocess death); interruption propagates as this RuntimeException wrapping InterruptedException.

Common situations: Multilang subprocess hung or crashed so it stops draining the write queue; worker shutting down/rebalancing while tuples are still in flight; extremely slow external script causing sustained queue backpressure at shutdown time.

Related errors


AI-assisted analysis of nathanmarz/storm@cdb116e942 (2026-09-12). Data as JSON: /api/errors/90a8e20c22be84ee. Report an issue: GitHub.

Appendix: source

Thrown at storm-core/src/jvm/backtype/storm/task/ShellBolt.java:179

    public void execute(Tuple input) {
        if (_exception != null) {
            throw new RuntimeException(_exception);
        }

        //just need an id
        String genId = Long.toString(_rand.nextLong());
        _inputs.put(genId, input);
        try {
            JSONObject obj = new JSONObject();
            obj.put("id", genId);
            obj.put("comp", input.getSourceComponent());
            obj.put("stream", input.getSourceStreamId());
            obj.put("task", input.getSourceTask());
            obj.put("tuple", input.getValues());
            _pendingWrites.put(obj);
        } catch(InterruptedException e) {
            throw new RuntimeException("Error during multilang processing", e);
        }
    }

    public void cleanup() {
        _running = false;
        _process.destroy();
        _inputs.clear();
    }

    private void handleAck(Map action) {
        String id = (String) action.get("id");
        Tuple acked = _inputs.remove(id);
        if(acked==null) {
            throw new RuntimeException("Acked a non-existent or already acked/failed id: " + id);
        }
        _collector.ack(acked);
    }

View on GitHub (pinned to cdb116e942)