I am of the strict opinion that unless the player characters kill a character or the script requires the character dies. You should never let any important characters, player characters included, die in a fight.
Some people like to believe that DnD is a game with win and loss conditions. But for me myself I cannot see that. Ultimately, in my opinion, the GM is there to provide a challenge but never win himself.
I am of the opinion that the GM should bend backward to keep the players alive. Whether that be a godly patron that decided to intervene or a passing adventurer that saves the party. It doesn't really matter what saves the players from their death, but ultimately I see that losing a fight should lead to a plot hook for future adventures and not to rerolling a character.
Ultimately I know it is just my opinion and other people will disagree, so I just wanted to encourage people to speak about whether player death in roleplaying games is good or bad to the story. Discuss please :)