Spirit Airlines (NASDAQ:SAVE) suffered huge numbers of flight cancellations earlier this month, as a long-running feud between management and the company's pilots spilled out into the open.

Ultimately, Spirit Airlines responded by suing its pilot union. On May 9, it won a temporary restraining order (TRO), barring the pilots from colluding in any way to disrupt the company's operations -- particularly by refusing overtime.

It took a few days for Spirit to get back on track, but flight cancellations have now returned to normal levels. However, in the long run, legal action is a poor substitute for labor peace. Spirit Airlines needs to mend fences with its pilots and reach a new long-term contract with them as soon as possible.

Flight cancellations recede

On several days in the first week of May, Spirit was forced to cancel more than 10% of its schedule because of a lack of pilot availability.

A Spirit Airlines plane

Spirit Airlines was forced to cancel hundreds of flights in early May. Image source: Spirit Airlines.

Not surprisingly, the airline and the pilot union had different explanations for this operational breakdown. Spirit Airlines said that as part of a coordinated job action, pilots had suddenly stopped volunteering to cover flights that didn't have a crew assigned in the initial round of scheduling. The ALPA union blamed the issues on understaffing and management incompetence.

Whatever the cause of the initial problems, they have been fixed in the weeks since a federal judge granted Spirit the TRO. Since mid-May, Spirit has canceled an average of 1%-2% of its daily schedule. That's roughly in line with historical averages. For example, in May 2016, Spirit canceled 1.4% of its flights.

Labor peace needs to be a priority

Just one month ago, Spirit Airlines seemed to be hitting its stride. The company offered strong unit revenue guidance for the second quarter and indicated that demand trends for the rest of the year looked solid as well. Furthermore, Spirit had made great strides in improving its on-time performance and customer satisfaction since early 2016.

The spate of flight cancellations earlier this month -- which culminated in a near-riot in Fort Lauderdale on May 8 -- represented a huge setback in this regard. Even though Spirit Airlines has become more reliable on average over the past year, it probably doesn't seem that way to potential customers, which is what really matters.

Thus, Spirit Airlines needs to make labor peace a bigger priority. The company did sign new contracts with its flight attendants and its Fort Lauderdale ramp workers last year, but it's important to get the pilots on board as well. As things stand now, the combination of an outdated contract and labor unrest will make it hard to recruit enough new pilots to meet Spirit's growth plans.

ALPA is shifting to a conciliatory tone

Since contract negotiations began a couple of years ago, Spirit's pilot union (ALPA) has loudly criticized management for not making an "industry-standard" contract offer. However, in the past few weeks, ALPA appears to have shifted to a more conciliatory tone.

For example, the union has agreed with Spirit to indefinitely extend the TRO while contract negotiations run their course, rather than fighting the order in court. Last week, ALPA put out a press release describing how Spirit's pilots and the union have helped the company get back to a normal flight schedule.

It's hard to know whether this new attitude will carry over to the bargaining table. Both sides would probably agree that Spirit Airlines pilots are woefully underpaid relative to peers at most other major airlines -- particularly at lower levels on the seniority ladder. But up until now, ALPA and Spirit's management have been sharply divided about how much the company should raise its pilots' wages (among other things).

Right now may be the best time for Spirit Airlines and its pilots to hit the reset button. It should be possible to reach a compromise that gives pilots the raises they deserve without hurting Spirit's profit margin so much that it would have to stop growing. Hopefully, the two sides will find that compromise solution sooner rather than later.

Adam Levine-Weinberg owns shares of Spirit Airlines. The Motley Fool recommends Spirit Airlines. The Motley Fool has a disclosure policy.