A knife is a deadly weapon. Even a non-deadly strike from a knife means a loss of organs (lung puncture, liver intrusion), limbs, facial tissue, eyes, etc. If someone is threatening with a knife (attacking cop cars, etc), especially if they are not acting entirely sanely, they are an active life-or-death threat and yes, you might absolutely be walking into the moments before your death.
Even if you have a gun, you have at best a few heartbeats to make a judgement call if they decide to lunge for you. Especially if your firearm is in it's holster, in the time it takes for an attacker to lunge at you, you need to:
1. Establish a positive grip on the firearm
2. Defeat any safety measures on the holster (snaps, buttons, interlocks)
3. Clear the holster with a duty sized firearm
4. Draw firearm to combat position
5. Secure off hand grip to firearm
6. Obtain sight picture
7. Check target and backstop
8. Squeeze trigger
The person who intends to kill you meanwhile needs to do the following:
1. Lunge forward with knife angled outwards
If it's available in your area, I recommend taking a use-of-force seminar and seeing how well you do with the above kind of scenario.
Yes, it'd be great if cops could bear hug everyone into submission, but that's not the reality of the situation.
Training should equip officers for the not-uncommon case when a suspect has a knife but is otherwise nonthreatening.