If all that rain in September and October was dampening your mood, think of what it was doing to wine lovers. There was much wailing and gnashing of teeth on social media by winemakers and wine fiends alike bemoaning one day’s deluge and the next day’s trickle, as harvest occurred not under the typical autumn sunshine but instead under a cloud of doom and gloom.

“Heavy rains have ruined Virginia’s wine grapes this year,” screamed a headline on DCist.com. That story ran originally on WAMU radio, with a less alarmist headline on its website calling 2018 “the worst year ever” for winegrowers in the Mid-Atlantic. The article detailed how growers were struggling to prevent grapes from rotting because of too much rain before they could ripen sufficiently to make decent wine. “In a year like this, we just try to survive,” one winemaker said. To be honest, that sounded a bit hysterical, considering people were literally trying to survive in the Carolinas and Florida after hurricanes Florence and Michael.

And yet, while some winegrowers struggle to survive in years like this, others refuse to surrender. Instead, they fight back. In the midst of all the diluvial despair, a blast email from Barboursville Vineyards, north of Charlottesville, broke through like a rainbow. “We declare an Octagon vintage,” wrote Barboursville’s winemaker Luca Paschina.

Octagon is Barboursville’s flagship red blend, based on merlot and cabernet franc. Paschina first made it from selections of his best grapes in the mid-1990s as an effort to produce an iconic Virginia wine. He has made Octagon every year since, except for 2000, 2003 and 2011, all exceptionally rainy years. Paschina said he will be able to make a 2018 Octagon, despite “75 days of persistent rain” from mid-May through July, because of two factors: a warm and relatively sunny August, and the hard work of vineyard manager Fernando Franco and his crew. They fought aggressively to control the vines’ vigor, which was fed by the rain, ruthlessly trimming the leaf canopy to force the vines’ energy into the grapes. They then discarded grapes that showed signs of rot or mildew, sacrificing crop size for quality.

We will have to wait a few years to decide where the 2018 Octagon will rank on a vintage chart. It most likely won’t be as ripe or rich as the 2009, 2010 or 2014. But Paschina’s decision to “declare the vintage” reflects his confidence that improvements in viticulture are helping his team cope with even “the most challenging vintage of this century.”

I heard a similar weary sense of optimism from other quarters, including Matthew Brown, wine club manager at King Family Vineyards in Crozet, Va. (Winemaker Matthieu Finot must have been busy in the cellar.) Citing the gloomy media coverage of the vintage, Brown noted that wines from challenging years often exceed initial expectations.

“Our 2011 Meritage is one of our favorite wines, and we practically picked that in a hurricane,” he said.

The memory of 2011 also haunted winemakers this season in New York’s Finger Lakes. As happened that year, a warm, sunny summer punctuated by some severe weather promised a favorable crop, until the rain spigots were turned on in September. “We had a lot of sleepless nights this harvest,” says August Deimel, winemaker at Keuka Springs winery in Penn Yan. “It doesn’t mean great wines aren’t being made, but it takes a lot more effort and courage to make tough decisions.”

This isn’t just an East Coast story. Improvements in viticulture and oenology are helping winemakers cope with the vagaries of vintage in Bordeaux and throughout Europe. This will be increasingly important as climate change throws new challenges their way. Bordeaux wrestled with higher than usual alcohol levels this year. Growers in Australia and along the U.S. West Coast and Canada’s British Columbia now have to factor wildfires into their calculations. Wherever wine grapes are grown, the seasons are becoming shorter and warmer on average, with harvest occurring earlier.

Extreme drought, constant rain, hail, frost: The unpredictability of the weather “makes it tough to do the right thing at the right moment,” says Gaia Gaja, of Italy’s Gaja wines in Piedmont and Tuscany. During a recent visit to Washington, Gaja described to me her family’s shift from emphasizing reactive measures (such as spraying fungicides after rain to prevent disease) to a more holistic focus promoting biodiversity to improve the overall health of the vineyard. She calls it “resilient viticulture.”

“The challenge is to develop a resilient vineyard that is able to adapt to various unpredictable challenges,” she said, “rather than responding to challenges as they arise.”

So don’t write off a tough year like 2018. As we consumers taste these wines, we should try to identify those winemakers who had the courage of their convictions and refused to surrender. That’s our challenge from 2018.

More from Food: