fix #7727, scheduling bug in `produce`