I think I've figured it out. I switched to GlobalWidnow with my custom trigger. My Trigger combines processingTime trigger logic and onElement trigger logic. Only one should be executed in scope of particular window.
I managed to do this by returning FIRE_AND_PURGE and cleat all timers and state whenever I'm closing the window. In my case I don't have "late events" that should be added into previously ended window so it simplifies the job. Thanks :) -- Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/