When starting an image render in Cycles (Menu Bar → Render → Render Image), the rendering starts immediately, but if the viewport is set to rendered, the rendering in the viewport continues too, making both viewport and image rendering take much longer than it should as the CPU or the GPU resources are split between the two.
Is this a bug or a feature? I’d definitely treat it as a bug but I am checking here before I report it.
Init is called whenever a new render engine instance is created. Multiple instances may exist at the same time, for example for a viewport and final render.
Note that a preview render of a material (shown with the sphere/cube/etc in the material editor) is also done through the RenderEngine API, so you might have a preview render in the viewport active, while also tweaking a material which has its rendering updated.
I find it good that the viewport keeps on rendering. I often want to continue looking at it or even working on the file while it renders.
What I do consider a bug, is sometimes the rendering stops (without warning) if I change something in the file. But not always, it’s hard to reproduce.