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

Threading issues #7815

Closed
rymsha opened this issue Jan 10, 2020 · 1 comment
Closed

Threading issues #7815

rymsha opened this issue Jan 10, 2020 · 1 comment
Assignees

Comments

@rymsha
Copy link
Contributor

rymsha commented Jan 10, 2020

  • Some OSGi services create executors (or other threads) which are never shut down. This leaks threads when configuration of such services changes. Solution is to call shutdown/shutdownNow in deactivate methods.

  • Some Executors are constructed with ThreadFactory which specifies UncoughtExceptionHandler, which is never called because all exceptions are actually caught by executor itself. Solution is to catch exceptions/throwables for correct processing directly inside Runnables.

  • Similar but worse issue is in use of ScheduledExecutors as they stop repeating tasks in case of exceptions thrown inside tasks.
    Attempts to solve this were made, but they didn't account Errors which were silently swallowed.
    Solution is to catch all exceptions so repeating stays alive. And log Errors before rethrowing them.

  • Some long-lived Threads have no names which makes them harder to identify. Give them appropriate names.

@rymsha rymsha added the Bug label Jan 10, 2020
@rymsha rymsha changed the title Thread leaks Threading issues Jan 12, 2020
@rymsha rymsha added Tech Debt and removed Bug labels Jan 12, 2020
@rymsha
Copy link
Contributor Author

rymsha commented Jan 13, 2020

for instance TaskManagerImplTest fails every now and when

@rymsha rymsha self-assigned this Jan 14, 2020
rymsha added a commit that referenced this issue Jan 17, 2020
rymsha added a commit that referenced this issue Jan 17, 2020
rymsha added a commit that referenced this issue Jan 18, 2020
rymsha added a commit that referenced this issue Jan 18, 2020
rymsha added a commit that referenced this issue Jan 18, 2020
rymsha added a commit that referenced this issue Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants