Faced with staffing shortages, airlines are canceling thousands of flights heading into the busy summer travel season.

Leading the trend has been Southwest Airlines, which has cut nearly 20,000 flights, according to a report from The Dallas Morning News. Its goal is to hire 10,000 new workers this year.

“I go through the Whataburger drive-thru and I pay and get my bag, and stapled to the bag is a job application,” Southwest CEO Robert Jordan joked this year. “That’s what it’s come to.”

Especially acute has been the shortage of pilots. According to one flight consultancy, U.S. airlines are trying to hire at least 12,000 pilots combined this year.

“The pilot shortage for the industry is real, and most airlines are simply not going to be able to realize their capacity plans because there simply aren’t enough pilots, at least not for the next five-plus years,” United Airlines CEO Scott Kirby said on a quarterly earnings call in April.

Delta, meanwhile, said it was canceling 100 daily flights from July 1 through Aug. 7 in the U.S. and Latin America.

Pilots unions like the Air Line Pilots Association dispute that there is a shortage, pointing to data showing that nearly 8,000 new commercial pilots have received certificates in the last 12 months. They claim the service cuts are instead being used as a pretext to boost profit margins by cutting training and safety requirements.

But most pilots with commercial licenses are not able to fly for mainstream carriers, said Kit Darby, the president of KitDarby.com Aviation Consulting. It can take up to five years and cost hundreds of thousands of dollars to train people to fly jets for even regional carriers, Darby said in an interview.

And smaller airlines and routes, Darby said, are bearing the brunt of the shortage. He pointed to SkyWest Airlines, a Utah-based carrier with a hub at Los Angeles International Airport, which said in April that it had lost 5 percent of its pilots to larger carriers. SkyWest did not immediately respond to a request for comment.

“We have a very serious problem,” Darby said. “Delta, United, American — they’re parking regional jets and picking the most profitable routes. Everyone else is getting smaller or no service.” 

Phoenix-based Mesa Air Group, which flies for American, United and the shipping logistics company DHL, lost millions of dollars in the first quarter of fiscal year 2022 amid flight cuts, the company said in its earnings report in February.

“We never fathomed attrition levels like this,” Mesa CEO Jonathan Ornstein told CNBC’s Leslie Josephs last month. “If we don’t fly our airplanes we lose money. You saw our quarterly numbers.”

He said it would take Mesa as long as four months to replace a single pilot.

“We could use 200 pilots right now,” he said.