backport fix from HEAD:

1785476 more state entries might be created for single connection
1 file changed