According to the Stack Overflow:
Normally, notebook connection expires after 12 hours and all the data loaded into colab will also > be expired with session. When you run a process and the notebook get disconnected after some time but before 12 hours, the code run in background. So, if you try to reconnect the notebook, it get stuck on "initializing" until the completion of code execution or session expiry (whichever occurs first). After that, the connection is established again.
So, can the execution run past 12 hours or run in the background without the browser session open for 12 hours?
Colab supports code cells running in the background for a short period. For example, suppose you have a code cell with:
import time
time.sleep(60)
print ('done')
If you begin executing that cell and refresh the page, the execution will resume. After some time, however, idle backends will be halted, even those with pending executions. (We are working to extend this interval over time. There's a tradeoff between support for long-idle resumption and resource consumption, as you might imagine.)
What do you mean by "short period"? Did you even answer the question?
Most helpful comment
What do you mean by "short period"? Did you even answer the question?