A police inspector who single-handedly ended a deadly stabbing rampage has been diagnosed with a rare and aggressive form of cancer.