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

Make CommonTaskExecutor periodic tasks safe #1366

Merged
merged 7 commits into from
Apr 13, 2020

Conversation

mar-kolya
Copy link
Contributor

  • Verify that we can schedule task and catch exceptions.
    This should help to avoid additional exceptions on app crash during
    startup.
  • Avoid holding strong references from within executor to make sure
    that things can get GCed.

@mar-kolya mar-kolya requested a review from a team as a code owner April 13, 2020 19:59
* Verify that we can schedule task and catch exceptions.
This should help to avoid additional exceptions on app crash during
  startup.

* Avoid holding strong references from within executor to make sure
  that things can get GCed.
@mar-kolya mar-kolya force-pushed the mar-kolya/safe-periodic-tasks branch from 3d25596 to 1fb844a Compare April 13, 2020 20:04
Copy link
Contributor

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

A few comments...

static final SpanCleanerTask INSTANCE = new SpanCleanerTask();

@Override
public void run(final SpanCleaner target) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider removing SpanCleaner and have this accept the list of pendingTraces instead. (Implement the run logic above directly.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

    if (cleaner != null) {
      cleaner.close();
    }
  • this makes things somewhat more interesting since we cannot hold reference to pending traces inside the task.

Would it be ok if I add a fixme for now here - this seems less trivial change?

Copy link
Contributor

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@mar-kolya mar-kolya merged commit 11035e4 into master Apr 13, 2020
@mar-kolya mar-kolya deleted the mar-kolya/safe-periodic-tasks branch April 13, 2020 23:23
@tylerbenson tylerbenson added this to the 0.49.0 milestone Apr 15, 2020
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.

None yet

2 participants