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

[server][controller] Try ungraceful close when the graceful one faile… #828

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

lluwm
Copy link
Contributor

@lluwm lluwm commented Jan 23, 2024

…d in VeniceWriter

In VeniceWriter.close(), when gracefulClose is set to true, Kafka producer call the underlining method, which tries to flush the buffered data before closing it (see ApacheKafkaProducerAdapter.close). However, when exception happens (e.g. timeout), today, VeniceWriter only logs the exception, moves on, and consider the VeniceWriter being closed while it is actually not. (A leaking Venicewriter can cause several issues, e.g. a stuck consumer thread etc.)

This change adds a retry of ungraceful close if gracefulClose flag is set to true and it failed. In this case, ungraceful close will skip the flushing step and it should always succeed (e.g. StoreIngestionTask.kill()). For cases where gracefulClose is set to false, this change doesn't change anything.

How was this PR tested?

Unit test.
CI.

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

…d in VeniceWriter

In VeniceWriter.close(), when gracefulClose is set to true, Kafka producer call the underlining method,
which tries to flush the buffered data before closing it (see ApacheKafkaProducerAdapter.close). However,
when exception happens (e.g. timeout), today, VeniveWriter only logs the exception, moves on, and consider
the VeniceWriter being closed while it is actually not. (A leaking venicewriter can cause several issues,
e.g. a stuck consumer thread etc.)

This change adds a retry of ungraceful close if gracefulClose flag is set to true and it failed.
In this case, ungraceful close will skip the flushing step and it should always succeed (e.g. StoreIngestionTask.kill()).
For cases where gracefulClose is set to false, this change doesn't change anything.
Copy link
Contributor

@gaojieliu gaojieliu left a comment

Choose a reason for hiding this comment

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

Thanks!

@lluwm lluwm merged commit c1d289e into linkedin:main Jan 26, 2024
33 checks passed
@lluwm lluwm deleted the try_nongraceful_close_when_graceful_fail branch January 26, 2024 03:12
lluwm added a commit to lluwm/venice that referenced this pull request Jan 31, 2024
linkedin#828)

* [server][controller] Try ungraceful close when the graceful one failed in VeniceWriter

In VeniceWriter.close(), when gracefulClose is set to true, Kafka producer call the underlining method,
which tries to flush the buffered data before closing it (see ApacheKafkaProducerAdapter.close). However,
when exception happens (e.g. timeout), today, VeniveWriter only logs the exception, moves on, and consider
the VeniceWriter being closed while it is actually not. (A leaking venicewriter can cause several issues,
e.g. a stuck consumer thread etc.)

This change adds a retry of ungraceful close if gracefulClose flag is set to true and it failed.
In this case, ungraceful close will skip the flushing step and it should always succeed (e.g. StoreIngestionTask.kill()).
For cases where gracefulClose is set to false, this change doesn't change anything.
lluwm added a commit to lluwm/venice that referenced this pull request Jan 31, 2024
linkedin#828)

* [server][controller] Try ungraceful close when the graceful one failed in VeniceWriter

In VeniceWriter.close(), when gracefulClose is set to true, Kafka producer call the underlining method,
which tries to flush the buffered data before closing it (see ApacheKafkaProducerAdapter.close). However,
when exception happens (e.g. timeout), today, VeniveWriter only logs the exception, moves on, and consider
the VeniceWriter being closed while it is actually not. (A leaking venicewriter can cause several issues,
e.g. a stuck consumer thread etc.)

This change adds a retry of ungraceful close if gracefulClose flag is set to true and it failed.
In this case, ungraceful close will skip the flushing step and it should always succeed (e.g. StoreIngestionTask.kill()).
For cases where gracefulClose is set to false, this change doesn't change anything.
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.

2 participants