The UK government should have walked away after 2 years, that's what Article 50 indicates. But of course Article 50 does not highlight all of the the difficulties for any member state trying to extract itself from a maze of conditions and obligations, which have accumulated, altered and amplified so much since joining the EEC in 1973. The succession of treaties and the introduction of the single market, Euro and the customs union resulted in a far more involved commitment than was envisaged and described to the UK public in 1972 and 1975, even though the Treaty of Rome indicated what was to come. Of course the UK could not leave without agreements for financial obligations and the people, at least.
After the referendum, it seemed that most MP's (and cabinet ministers) had no clue as to the extent of the level of control that the EU had gained over a, supposedly sovereign UK. The Civil Service kept quiet and had evidently been happy with the status quo for years - the EU saved them a lot of work, so they only started crying after the leave vote - lazy overpaid bums.