Skip to content

server: contain exceptions thrown by user callbacks - #198

Open
physwkim wants to merge 1 commit into
epics-base:masterfrom
physwkim:fix/monitor-setup-exception
Open

server: contain exceptions thrown by user callbacks#198
physwkim wants to merge 1 commit into
epics-base:masterfrom
physwkim:fix/monitor-setup-exception

Conversation

@physwkim

@physwkim physwkim commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

MonitorSetupOp::connect() throws for a pvRequest which selects no fields, and only SharedPV guards it (connectSub()), so with SingleSource, GroupSource, or any Source written from the docs, a client sending field(nosuchfield) reset the whole TCP circuit and dropped its other channels. On the DESTROY_REQUEST path the throw also escapes ServerOp::cleanup() before state=Dead, so ~ServerOp() trips its assert. The new testmon cases fail without this change; the first of them needs no throwing user code at all.

Callbacks reached through acceptor_loop.dispatch() (onLowMark(), onHighMark(), the dispatched closer) are already covered by evbase::Pvt::doWork() and are untouched; the CMD_CANCEL_REQUEST guard has no test because pvxs' own client never sends that message.

A throw from onSubscribe(), onStart(), onCancel() or onClose() reached
ConnBase::bevRead(), which resets the circuit and so drops every other
channel on it.  MonitorSetupOp::connect() throws for a pvRequest which
selects no fields, so a Source not repeating SharedPV's own try/catch
lets any client do that.  Escaping ServerOp::cleanup() also leaves the
op short of Dead, so ~ServerOp() asserts.
@physwkim
physwkim force-pushed the fix/monitor-setup-exception branch from d3dcc1f to bd2243d Compare July 27, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant