Scrivio Interview library
ScenarioAdvanced6 min read · updated 12 November 2026

On-call engineers say reactive services are much harder to debug than MVC services. What would you put in place at the platform level?

At the platform level I would make the debugging information that MVC gives for free available by default in reactive services: ReactorDebugAgent or checkpoints in critical pipelines so errors point at our code, automatic context propagation so every log line and trace has a trace id, and Reactor and Netty metrics such as pending tasks, event-loop latency and connection pool use. Around that I would add runbooks for the common failure patterns (blocked event loop, pool exhaustion, lost subscriptions), training and review checklists, and an honest look at whether every service needs to be reactive.

Background to this question

When on-call engineers say reactive services are harder to debug, they are usually right, and the reasons are specific: stack traces that show operators instead of code, log lines without trace ids, thread dumps where every thread is idle while requests time out, and failure modes with no error at all. Telling each team to fix this alone produces a dozen partial solutions. A platform team can fix most of it once, in the shared starter and the shared runbooks. In this answer, we will name what makes reactive debugging hard, then go through each platform measure and the problem it addresses, and finish with when to question the use of reactive at all.

1Why Reactive Services Are Harder to Debug

In an MVC service, the tools we already know answer most questions. A stack trace shows the chain of calls from the controller to the failing line. A thread dump during an incident shows what every request is waiting for, because each request owns a thread. And MDC puts the trace id in every log line, because the request stays on one thread.

In a reactive service all three break. Stack traces show operator internals because the pipeline was assembled in one place and executed later. Thread dumps show a few event-loop threads, often idle, because waiting requests do not hold threads; their state lives in objects in the heap. And log lines lose the trace id when the pipeline changes threads. On top of that, some failures produce no error at all: a subscription that never happens, an empty Mono that becomes a 200, a blocked event loop that just makes everything slow. So the platform's job is to give engineers new tools that answer the same questions.

What on-call engineers need and what provides it
QuestionMVC answerReactive answer from the platform
Where in our code did it fail?stack traceReactorDebugAgent, checkpoints
Which request is this log line?MDC on the threadautomatic context propagation
What are requests waiting on?thread dumppool and pending task metrics, traces
Is something blocking?busy threads in a dumpevent-loop latency metric, BlockHound in CI
Why no error but no data?rarerunbook: lost subscriptions, empty Monos

2Errors That Point at Our Code

The shared starter adds reactor-tools and enables ReactorDebugAgent, which rewrites our classes at load time so every operator carries its source file and line. When an error occurs, the traceback lists the operators it passed through with our file names and line numbers, at low runtime cost. The platform should measure the startup cost on a large service, and if a service cannot accept it, the fallback is descriptive checkpoint() calls at the boundaries of critical pipelines, such as the client adapters and the controller methods, which are very cheap.

3Trace Ids in Every Log Line

The starter enables automatic context propagation, so Reactor restores the MDC from the Reactor Context around every operator callback and log lines inside map or flatMap carry the trace id. It also enforces that WebClient instances are built from Boot's injected builder, so outgoing calls are traced, and sets a logging pattern that includes trace and span ids. With this, an engineer can take a trace id from a failing request and see every log line and every downstream call for it, which replaces much of what a thread dump used to tell us.

4Metrics for Event Loops and Pools

Reactive services need a few metrics that MVC services do not, and the starter should publish them with a standard dashboard. Event-loop latency, the time a task waits before an event loop runs it, is the single best signal of blocking: in a healthy service it stays in microseconds, and a blocked loop shows it jumping to hundreds of milliseconds. Pending tasks per event loop tell the same story. Reactor Netty can expose connection pool metrics for WebClient (active, idle and pending connections per remote host), and r2dbc-pool exposes its own, which reveal pool exhaustion. Reactor's scheduler metrics show how busy boundedElastic is.

Alerts on these metrics turn invisible failures into visible ones: a p99 event-loop latency over 50 ms, or pending acquisitions on a pool for more than a minute, page the owner before customers notice.

Step throughPlatform debugging support in the shared starter
  1. Dashboards and alertsevent-loop latency, pool pending, empty responses
  2. MetricsReactor Netty, r2dbc-pool, schedulers via Micrometer
  3. Tracing and logscontext propagation, trace ids in MDC, instrumented clients
  4. Error locationsReactorDebugAgent, checkpoints at boundaries
  5. TestsBlockHound and StepVerifier templates

5 layers, from the top down. Step through them one at a time.

5Runbooks for the Common Failure Patterns

Most reactive incidents fall into a handful of patterns, and each deserves a short runbook that says how it looks and what to check. A blocked event loop looks like rising latency across all endpoints with low CPU and rising event-loop latency; the steps are to take a thread dump and look at what the reactor-http-nio threads are doing, since a blocked loop shows a stack inside a blocking call, then find the call and move it to boundedElastic. Pool exhaustion looks like timeouts on calls to one dependency with pending acquisitions on its pool; the steps are to check the dependency's latency and the pool size. A lost subscription looks like missing side effects with no errors, such as audit records that never appear; the steps are to search for detached subscribe() calls and ignored Mono return values. Empty 200 responses have their own runbook built around untyped fallbacks.

Step throughRunbook: latency rising on every endpoint
  1. Is CPU high?
    YesLook for CPU-heavy work or GCNoSuspect blocking or pools
  2. Is event-loop latency high?
    YesBlocked event loop: take a thread dumpNoCheck pool pending metrics
  3. Thread dump: nio thread inside a blocking callfor example socket read or lock wait
  4. Move the call to boundedElastic, add a BlockHound testthen confirm latency recovers

4 steps in order. Play them, or step through them one at a time.

6People, Reviews and the Right Tool

Tooling only helps people who know how to read it. I would run short training sessions on reading Reactor tracebacks, using the dashboards and following the runbooks, and add a reactive section to the code review checklist: no subscribe() in methods, typed fallbacks, blocking isolated on boundedElastic, checkpoints at boundaries.

Finally, the platform team should say the honest part out loud. Some services became reactive because it was the fashion, not because they needed it. For a CRUD service with modest load, Spring MVC on virtual threads gives most of the concurrency benefit with ordinary debugging. Part of making on-call easier is guiding new services to the simpler stack unless they have a real reason, such as streaming or high fan-out, to be reactive.

7Follow-up questions

How do you take a useful thread dump of a reactive service?

The same way, with jstack or jcmd Thread.print, but we read it differently. We look at the event-loop threads, named like reactor-http-nio-1. If they are idle, waiting in epoll, the event loops are fine and the problem is elsewhere, likely a slow dependency or pool. If one is inside a socket read, a lock or a JDBC call, that is a blocking call on the event loop.

Does ReactorDebugAgent belong in production?

Usually yes, because its runtime cost is low and it makes production errors readable. The platform team should measure startup time and memory on its largest services first. Hooks.onOperatorDebug, by contrast, should never be on in production, because it captures stack traces at every assembly.

How would you measure whether the measures worked?

Track mean time to resolve incidents for reactive services and compare with MVC services, before and after the rollout, and ask on-call engineers in a short survey which tools they used. If resolution time falls and the dashboards are used, the investment worked.

8Conclusion

In this answer, we turned the complaint that reactive services are harder to debug into specific gaps: stack traces without our code, logs without trace ids, thread dumps that show nothing, and failures without errors. The platform answers each one: ReactorDebugAgent or checkpoints for error locations, automatic context propagation for trace ids, Reactor and Netty metrics with dashboards and alerts for event-loop latency, pending tasks and pools, runbooks for blocked event loops, pool exhaustion and lost subscriptions, and training with review checklists. We also questioned whether every service needs to be reactive at all.

What to say in the interviewAbout 90 seconds aloud

Open with

I would start by agreeing with them, because the reasons are concrete: stack traces show operators instead of our code, log lines lose trace ids when pipelines switch threads, thread dumps show idle event loops while requests time out, and some failures, like lost subscriptions or empty Monos, produce no error at all.

Then, if they want more

Then I would close each gap in the shared starter so every reactive service gets it by default. ReactorDebugAgent from reactor-tools, or checkpoints at boundaries where startup cost matters, so errors point at our file and line.

Automatic context propagation, instrumented WebClient from Boot's builder, and a logging pattern with trace ids, so one trace id finds every log line and downstream call. Metrics and a standard dashboard for event-loop latency and pending tasks, which are the clearest signs of blocking, plus WebClient and R2DBC pool metrics for exhaustion, with alerts.

Then runbooks for the common patterns: blocked event loop, how to read the nio threads in a thread dump; pool exhaustion; lost subscriptions; empty 200s. And training plus a review checklist covering subscribe calls, typed fallbacks and blocking isolation.

Finally I would be honest that some services do not need to be reactive; for ordinary CRUD services, MVC on virtual threads gives the concurrency with ordinary debugging, so I would steer new services there unless they have a real reason like streaming.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "On-call engineers say reactive services are much harder to debug than MVC services. What...": https://scrivio-interview-library.netlify.app/spring-boot/reactive-testing-and-ops/b48c801eef/