Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does TimeoutHandler get to throw Exception? #397

Open
Palmr opened this issue Oct 13, 2021 · 2 comments
Open

Why does TimeoutHandler get to throw Exception? #397

Palmr opened this issue Oct 13, 2021 · 2 comments
Milestone

Comments

@Palmr
Copy link
Member

Palmr commented Oct 13, 2021

TimeoutHandler::onTimeout throws a checked exception if the implementation is unable to handle the timeout.

BatchEventProcessor::notifyTimeout catches Throwable, so no need for checked exception type.

The exception gets passed to the exception handler which may handle or bail out of the BatchEventProcessor::processEvents depending on the ExceptionHandler implementation.

This is leaning towards use of exceptions for control flow and perhaps we could look at returning something useful from TimeoutHandler::onTimeout instead?

@Palmr Palmr created this issue from a note in 4.0 (To do) Oct 13, 2021
@Palmr Palmr added this to the 4.0 milestone Oct 13, 2021
@SteafanMrZhou
Copy link
Contributor

I think the ExceptionHandler is only leaning towards to graph all type exceptions and distributing to exception handler by excetion type.
Liking this way,TimeoutHandler::onTimeout can deal with itself exception and return something useful information about timeout:waitTime,isInterrupted,isDeadLock,etc.
Anykinds exception will deal with like this in disruptor.

@grumpyjames
Copy link
Member

grumpyjames commented Aug 18, 2022

There's a further point raised from #429 which makes me think "isn't the whole of timeout handling massively exception-as-control-flow ?"

@Palmr Palmr modified the milestones: 4.0, 5.0 Sep 29, 2023
@Palmr Palmr removed this from To do in 4.0 Sep 29, 2023
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

No branches or pull requests

3 participants