boolangery
boolangery

Reputation: 315

Is Statefull doFn supported by google dataflow runner?

I cannot make a batch fn work on Dataflow. I used the one in example here in Go: https://beam.apache.org/documentation/programming-guide/#state-timers-examples

The dofn receive element and trigger the OnTimer once and then everything get stuck (I can see it with logs).

I'am in streaming mode. So my first question is do Dataflow support Timers in Go? If yes what I'm doing wrong? I literrally copied the example.

Upvotes: 1

Views: 80

Answers (1)

boolangery
boolangery

Reputation: 315

Ok, for everyone struggling with same issue on Dataflow, you have to add this line is the OnTimer() callback:

fn.OutputState.ClearTag(tp, timer.Tag) // Clean up the fired timer tag. (Temporary workaround for a runner bug.)

(this line is present in the example on github but not in the documentation)

Upvotes: 1

Related Questions