Skip to content

Handling Thread.interrupts #3635

Description

@nPraml

Hello @rbygrave ,

In our application, we have a scheduler that starts multiple threads in parallel for various tasks that can be completed independently of each other (e.g. importing customers, evaluating user logins, etc.).
It's also possible for users to cancel/abort such tasks in the UI.
Aborting involves the scheduler sending an interrupt signal to the Java threads.
We have the problem that the threads often just keep running and don't notice the interrupt because they're busy executing DB actions.

We've been considering whether it would be useful to implement a mechanism in a very central location in ebean and/or ebean-datasource that detects whether the thread has been interrupted and:

We'd like to ask for your opinion on what you would do regarding interrupts. Are we thinking in the right direction?
We've read this article regarding Thread.interrupt(): https://medium.com/@AlexanderObregon/javas-thread-interrupt-method-explained-0df0f8f6a428

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions