The housing market has certainly made progress since 2008, when its crash nearly broke the global financial system.

But it works in cycles. And while few economists are warning about existing 2008-type conditions, some housing markets are getting close.

The demand for housing is strong, but a lack of inventory has left many buyers unable to find the homes they want. In turn, this shortfall has raised house prices, especially in the affordable segment of the market.

In a note on Thursday, John Burns Real Estate Consulting broke down the five stages of the housing-market cycle, including where it sees some major cities in each phase.

"We believe that the vast majority of markets remain in the Expansion phase," wrote Rick Palacios Jr., director of research. Capital investment is increasing and home prices are too, although they're still below the prior peak.

But markets like San Francisco Bay Area, Seattle, Dallas, and Austin are "pretty close to the 7th-inning stretch," Palacios wrote. In baseball, that's the pause between the top and bottom halves of the seventh inning when many spectators grab a drink or some snacks and sing "Take Me Out to the Ballgame."

In the housing market, it's the peak, just before things start going sour.

"These four markets are currently some of the strongest and most profitable markets in the country for our clients —and could very well remain so for quite some time, especially if rates stay low and tech avoids a major correction."

The monthly S&P/Case-Shiller index showed that home prices in San Francisco rose 6.4% in August, the smallest annual increase in four years. So there are some signs of cooling.

But Houston is the only market that's is already looking dangerously close to collapsing.

The city's housing market has been crushed by the oil-price downturn, which cost tens of thousands of jobs and slowed a lot of apartment construction.

Palacios forecasts that Houston will hold up through 2017 and would avoid a full-blown downturn, or the fifth stage of his chart.