Thanks very much for reply. I think it may be better to assert failed to exit problem than run the endless loop after receivered DEVICE_REMOVAL event. Or we can sleep 5 ms to check if the conn->h.state is STATE_FULL.
Note that neither of the CC'd lists are the correct list for stgt, you should correspond stgt@xxxxxxxxxxxxxx Regarding your observation, not sure why you think this is happening, the work is queued once in 5 seconds and the loop is finite.