David Johnson, 55, has been sober for a decade.

“When I came in I was a mess,” he said.

To get by, he relies on Bridgewell, a nonprofit on the North Shore that provides a range of services for people like David, helping manage his disabilities and pay his bills, so he can stay focused on being sober.

“I couldn’t make it right now without them. I’ll admit that,” he said.

Bridgewell also puts a roof over David’s head, and many others, by managing more than 100 apartments that are subsidized by the federal government.

And as the shutdown drags on the government funding is drying up.

Several nonprofits in Massachusetts that receive subsidies for the apartments they provide to low-income residents are scrambling to keep their other programs running while the federal money runs out.

The nonprofits have to renew their contracts with the federal Department of Housing and Urban Development every year, and the groups whose contracts began expiring after the shutdown began Dec. 21 are losing subsidies until federal employees return to work to renew those contracts.

“It’s a life and death situation,” Johnson said.

When one of Bridgewell’s contracts expires next week, subsidies for a half dozen apartments will stop, and it will have to pay market rents for those apartments while juggling to maintain all those other social services programs.

Bridgewell serves about 6,500 people each year, said Interim Director Chris Tuttle. The loss of that housing revenue means they would have to put off hiring staff and freeze programs.

“That could lead to more families being homeless, that then has a ripple effect to individuals that are trying desperately to turn their life around, get clean or whatever, and everything is put on pause,” he said.

Contracts for about 1,000 apartments across Massachusetts for people with very low incomes have expired as of Friday. Another roughly 650 are in jeopardy in the next few weeks.

Nationwide, subsidies have expired for more than 26,127 apartments. By the end of next month, that will balloon to 59,116.

And by then other government assistance will be in jeopardy, including food assistance.

“There are a number of families that will be in limbo who thought they were going to be placed who won’t be placed,” Tuttle said.

For David Johnson and his neighbors, the uncertainty threatens the stability they depend on to stay sober and on track.

“I think about going homeless,” he said. “It’s reality, so everybody says, well live in the day. It’s hard to live in the day when the TV’s right there. How can you not think about it?”

Some for-profit landlords with larger buildings told the NBC10 Boston Investigators they can dip into savings or reserves in order to keep their tenants until the shutdown is resolved.

And they added that they’re committed to staying in the Section 8 program.

But the shutdown shows no sign of ending, and both landlords and nonprofits said they can only juggle for so long.