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

NIFI-11896 Correct QuestDB Status Repository Shutdown handling #7564

Closed
wants to merge 1 commit into from

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-11896 Corrects QuestDB Status Repository shutdown handling at runtime and during unit tests.

Changes include updating the repository start and shutdown methods to track scheduled future tasks and attempt cancellation before shutting down the executor service. This approach provides a stronger guarantee of stopping scheduled tasks than shutting down the executor service itself.

Additional changes include setting the initial delay for scheduled tasks from 0 to the configured interval, avoiding initial execution when starting the repository. This approach avoids unnecessary task execution in unit tests.

Test changes include setting the out System property pointing to the QuestDB logging configuration, avoiding unnecessary debug logs during unit testing, which can corrupt the console output stream, described in NIFI-11897.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Updated QuestDB Status Repository shutdown method to cancel scheduled tasks before immediate shutdown of Scheduled Executor Service
- Updated QuestDB Scheduled Tasks to include initial delay to avoid unnecessary execution when starting
- Updated QuestDB test class to minimize logging for QuestDB 7
- Improved logging and exception messages
@joewitt
Copy link
Contributor

joewitt commented Aug 2, 2023

Two full clean builds with all the trimmings worked perfectly/. And no dumpstream. Nice!

@asfgit asfgit closed this in 04cd6c2 Aug 3, 2023
asfgit pushed a commit that referenced this pull request Aug 3, 2023
- Updated QuestDB Status Repository shutdown method to cancel scheduled tasks before immediate shutdown of Scheduled Executor Service
- Updated QuestDB Scheduled Tasks to include initial delay to avoid unnecessary execution when starting
- Updated QuestDB test class to minimize logging for QuestDB 7
- Improved logging and exception messages

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #7564.
exceptionfactory added a commit to exceptionfactory/nifi that referenced this pull request Aug 14, 2023
- Updated QuestDB Status Repository shutdown method to cancel scheduled tasks before immediate shutdown of Scheduled Executor Service
- Updated QuestDB Scheduled Tasks to include initial delay to avoid unnecessary execution when starting
- Updated QuestDB test class to minimize logging for QuestDB 7
- Improved logging and exception messages

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes apache#7564.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants