Currently in ResultPartition#createSubpartitionView it would check whether this partition is released before creating view. But this check is based on refCnt != -1 which seems invalid, because the reference counter would not always reflect the released state.
In the case of ResultPartition#release/fail, the reference counter is not set to -1. Even if in the case of ResultPartition#onConsumedSubpartition, the reference counter seems also no chance to be -1.
So we could check the real isReleased state during creating view instead of reference counter.