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

[FLINK-5218] [state backends] Eagerly close checkpoint streams on cancellation #2920

Closed
wants to merge 1 commit into from

Conversation

StephanEwen
Copy link
Contributor

When a task is canceled during a checkpoint operation, the operation needs to cancel fast.

This is a forward fis from version 1.1, where checkpoints could get stuck when the state output streams did not handle interruptions correctly (HDFS has that problem).

Most of this is already handled in version 1.2 via the CloseableRegistry.

This adds a test to validate this case is handled correctly and adds minor changes to make it work reliably, like:

  • fail fast on write() on closed checkpoint streams
  • fail fast on flush() on closed checkpoint streams
  • slight optimization to save a flag in the checkpoint streams

… Streams are eagerly closed on cancellation.

This is important for some stream implementations (such as HDFS) that do not properly
handle thread interruption.
@StephanEwen
Copy link
Contributor Author

@StefanRRichter There is one change of semantics that would be good to get your input on: A checkpoint stream to which a byte[0] array was written is now actually empty and returns a null state handle in the same way as if nothing was ever written. Before this change, it would have created a state of zero bytes.

@StefanRRichter
Copy link
Contributor

I think the changed semantics makes actually more sense. It should also be fine for all callers, as returning null to them was also previously possible and IRC there should be no special meaning to an empty handle in 1.1.

@StephanEwen
Copy link
Contributor Author

Thanks for the review, merging this...

@StephanEwen
Copy link
Contributor Author

Manually merged in cc006ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants