[FLINK-1208] remove stack overflow potential