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

Variable drain time when shutting down via shutdown API #4966

Closed
dlvenable opened this issue Sep 20, 2024 · 1 comment · Fixed by #4970
Closed

Variable drain time when shutting down via shutdown API #4966

dlvenable opened this issue Sep 20, 2024 · 1 comment · Fixed by #4970
Labels
enhancement New feature or request
Milestone

Comments

@dlvenable
Copy link
Member

Is your feature request related to a problem? Please describe.

When running Data Prepper, we sometimes we want to shutdown Data Prepper faster than it is configured for.

Presently, the Data Prepper shutdown process will wait for the buffers to drain.

buffer:
  kafka:
    drain_timeout: 30m

In some cases, we want to drain faster, say in 10 minutes.

Describe the solution you'd like

Update the shutdown API to allow for an alternate drain time.

curl -X POST http://localhost:4900/shutdown?drainTime=10m
@dlvenable
Copy link
Member Author

Originally I proposed a drainTime parameter. However, there are multiple times involved currently. So instead of drainTime, I believe bufferReadTimeout and bufferDrainTimeout would be more appropriate.

The bufferReadTimeout will control how long to wait for the buffer to empty. This will control the run loop that is waits for the buffer to be completely empty. With a Kafka buffer, this may never happen.

The bufferDrainTimeout will override the Buffer:getDrainTimeout.

dlvenable added a commit to dlvenable/data-prepper that referenced this issue Sep 21, 2024
Adds two new parameters to the shutdown API. The first is bufferReadTimeout which controls the amount of time to wait for the buffer to be empty. The second is bufferDrainTimeout which controls the overall wait time for the process worker threads to complete.

To support Data Prepper durations in HTTP query parameters, I extracted the parsing logic for durations out of DataPrepperDurationDeserializer and into a new DataPrepperDurationParser class.

Resolves opensearch-project#4966.

Signed-off-by: David Venable <[email protected]>
@dlvenable dlvenable added enhancement New feature or request and removed untriaged labels Sep 21, 2024
@dlvenable dlvenable added this to the v2.10 milestone Sep 21, 2024
@github-project-automation github-project-automation bot moved this from Unplanned to Done in Data Prepper Tracking Board Sep 23, 2024
sb2k16 pushed a commit to sb2k16/data-prepper that referenced this issue Oct 4, 2024
…earch-project#4970)

Variable drain timeouts when shutting down over HTTP shutdown.

Adds two new parameters to the shutdown API. The first is bufferReadTimeout which controls the amount of time to wait for the buffer to be empty. The second is bufferDrainTimeout which controls the overall wait time for the process worker threads to complete.

To support Data Prepper durations in HTTP query parameters, I extracted the parsing logic for durations out of DataPrepperDurationDeserializer and into a new DataPrepperDurationParser class.

Resolves opensearch-project#4966.

Signed-off-by: David Venable <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant