A Quebec chemist and his sons charged with production of ecstasy and conspiracy to produce the drug have obtained a stay of proceedings after it took too long for their case to get to trial.

Quebec court Judge Rena Emond rendered her ruling Wednesday in the case of Daniel Cozak and his sons Samuel and Charles.

Emond said the majority of the two-year delay since their arrest was not attributable to the defence.

A 2016 Supreme Court ruling, commonly known as the Jordan decision, has forced changes to ensure delays don't exceed 18 months in provincial court cases and 30 months in Superior Court trials.

The three men were arrested in September 2015 and had been detained since.

At the time, the RCMP said in a release they'd found a clandestine lab in Lac-Baker, N.B., which was described by an official as one of the most sophisticated labs ever discovered in the province.