Canadians need a visa, which you buy upon arrival just before you reach passport control (it cost me $15 last year). The terminal EK uses there is a bit of a mess, so not sure if you could exit and re-enter and reach your gate in time. In most MENA airports, the EK check-in desk closes one hour before scheduled departure.