I am bloody well entitled to some super-science fiction about this. The field hasn't had enough astronomical disasters lately. 
 conservative estimate because the sun's gonna be a red giant and engulf the earth) in about 4 billion years, and for all I know, there are tectonic and/or atmospheric issues which will make the earth uninhabitable by then. 
 I've read that school teachers are told to tell kids that we'll find a solution by then.
 My commenters will probably know of 3 or 4 books that I either haven't heard of or have embarrassingly forgotten.
 Egan's Diaspora had an entirely satisfactory gamma ray burster, but it's been 15 years already.
 A million and a quarter years from now, this post will be quoted as an example of the irresponsible carelessness of the Ancients. And besides, they had footnotes out of order.
Link thanks to theweaselking.