Skip to content

Conversation

@bergundy
Copy link
Member

What changed?

  • Remove defer metrics.CapturePanic and log.CapturePanic calls from all handler methods, that is now handled in the chasm interceptor
  • Remove named return parameters (retError, retErr) from handler signatures
  • Standardize error variable naming to consistently use 'err'
  • Remove isStopped checks as they're redundant with graceful shutdown draining happening before stopping the handler

@bergundy bergundy requested review from a team as code owners January 23, 2026 19:14
if strings.HasPrefix(info.FullMethod, chasmRequestPrefix) {
defer metrics.CapturePanic(i.logger, i.metricsHandler, &retError)
}
defer metrics.CapturePanic(i.logger, i.metricsHandler, &retError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why in the CHASM interceptor? Not where I would look for this necessarily. Is a separate, dedicated interceptor unreasonable (e.g. perf reasons)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perf reasons. Agree it's not the ideal place for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add a comment in the file to redirect readers to the right place.

ctx context.Context,
_ *historyservice.DeepHealthCheckRequest,
) (_ *historyservice.DeepHealthCheckResponse, retError error) {
defer log.CapturePanic(h.logger, &retError)
Copy link
Contributor

@stephanos stephanos Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely remember from my attempt 2+ years ago that this changed the panic details somehow; but I don't recall the details ... okay, I ran an experiment and there's one meaningful difference: the current version has a service log tag that the new one doesn't. Now, is that relevant is the question.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... yeah, I can add the tag to the interceptor's logger.

func (h *Handler) StreamWorkflowReplicationMessages(
server historyservice.HistoryService_StreamWorkflowReplicationMessagesServer,
) (retError error) {
defer metrics.CapturePanic(h.logger, h.metricsHandler, &retError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a streaming endpoint; is the CHASM interceptor applied here?

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.

2 participants