TS-2815: update to check the state of the connection before rescheduling the
write