[
https://issues.apache.org/jira/browse/FLINK-21308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17339042#comment-17339042
]
Igal Shilman commented on FLINK-21308:
--------------------------------------
Hi [~stephanpelikan]! Thanks for proposing this feature and taking a stab with
the implementation.
First of all, I do think that this can be useful, especially to long running
processes for months and years. So I'm eggar to move forward with this.
However I think that there are some tricky parts in this specific proposal.
1) I think it is important to reflect that undoing a send is a best effort
operation, and might actually be too late to undo a message.
2) I didn't understand why sendAfter now receives a Function<> ?
3) compatibility with previous snapshot
I don't think this would work when restoring from a savepoint:
[https://github.com/apache/flink-statefun/compare/release-2.2.1...stephanpelikan:feature/FLINK-21308_unsendAfter?expand=1#diff-170839ae52efa0bd357394ca6d8e3e3dd6ed4c0ae20ed4d548a2f50543637ae6R232]
cc: [~tzulitai]
4) This change needs to be also reflected in the remote SDK.
Overall, I think that overall, it would be better to proceed as follows:
1) Lets agree on a reasonable API for unending delayed messages and be very
explicit that this is a best effort thing.
2) Lets think what would be a good representation for a delated message id?
(perhaps a pair of : <timestamp, random int>, maybe encoded as a string like
you proposed)
3) We need to be mindful about backwards compatibility here. And this is the
reason I'd suggest adding this ID into the Message class itself (should'nt be
user visible, only runtime)
And, under the assumption that a single function instance will have a
reasonable amount of timers, I'd suggest still remaining with a List state, and
removing
the desired message by a linear iteration.
What do you think [~stephanpelikan] and [~tzulitai]?
> Cancel "sendAfter"
> ------------------
>
> Key: FLINK-21308
> URL: https://issues.apache.org/jira/browse/FLINK-21308
> Project: Flink
> Issue Type: New Feature
> Components: Stateful Functions
> Reporter: Stephan Pelikan
> Priority: Minor
> Labels: auto-deprioritized-major
>
> As a user I want to cancel delayed sent messages not needed any more to keep
> state clean.
> Use case:
> {quote}My use-case is processing business events of customers. Those events
> are triggered by ourself or by the customer depending of what's the current
> state of the ongoing customer's business use-case. We need to monitor
> delayed/missing business events which belong to previous events. For example:
> the customer has to confirm something we did. Depending on what it is the
> confirmation has to be within hours, days or even months. If there is a delay
> we need to know. But if the customer confirms in time we want to cleanup to
> keep the state small.
> {quote}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)