After his retirement he remained in Xinjiang. The whole time he had to deal with the Ili Rebellion.
The passage describes a person who retired and continued to live in Xinjiang while facing the ongoing Ili Rebellion.