The fact that God didn't let Jonah drown gives him room to repent. He repeatedly refers to God as Yahweh (Jonah 2:2,6,7,9) - calling God by his covenant name and thus emphasising his faith in God's mercy and faithfulness. God alone is the source of steadfast love (Jonah 2:8). He is thankful that God is a merciful (Jonah 2:9). As in Romans 2:4, the knowledge of God's mercy leads him to repent.
People get hung up on God announcing destruction and judgement. Like it's a mean thing to do. It seems that they forget the deep spiritual lessons of so many Bond films. Whenever Bond gets caught, he usually has to endure being told with great glee by the Bad Guy™ what he, the Bad Guy™, plans to do to 007. If we'd found a Bad Guy™ who shot first and explained later, the Bond franchise would have been limited to releasing prequels for years.
The deep spiritual lesson? That judgement pre-announced is an opportunity for judgement to be avoided. Jonah rightly identifies that God's non-fatal judgement is an invitation for him to change. By the time he's in the belly of the fish, he's aware that he should be dead - but finding that God has spared his life shows him God's mercy: God has not given up on him.
It works exactly the same way for Nineveh a couple of chapters later: the King of Nineveh recognises that the announcement of God's judgement (Jonah 3:5-9) is an opportunity for repentance.
And we see it at the cross - as Paul says in Romans 2:4 - God's kindness is meant to lead us to repentance. How can we treat a God willing to spare us as our enemy any more? How can we doubt that he is good? Why would we continue to rebel against him?