Updating or rebuilding Discourse disables read-only mode?


(ljpp) #1

When I do server or Discourse maintenance, I always enable read-only mode. It is a good UX practice, so that I don’t bring the site down while someone is composing a forum post.

However I’ve noticed that Discourse pops out of read-only mode after upgrade or launcher rebuild. This is undesirable. I obviously wan’t do all maintenance duties at hand, incl. server updates & potential reboot, and only after enable the site again for discussion.

Is this a bug?

P.S. A proper maintenance mode with an announcement page would a nice feature.


(Régis Hanol) #2

It used to work… I’ll have a look.

Since nginx is running inside the container, you will have to run your own web server outside the container if you want a maintenance page when doing a rebuild.


(Régis Hanol) #7

For some reason, I thought you were talking about the backup/restore workflows… We unfortunately don’t support keeping the readonly state across rebuilds.

The reason is that the readonly mode state is stored in redis with an expiration of 1 minute. That way, if a site ever ends up stuck in readonly mode (due to a process being killed), it’ll be automatically disabled after 1 minute. To allow readonly mode to last longer than 1 minute, we have a thread that update that expiration date every 30 seconds. The issue is that that thread doesn’t survive a rebuild of the container.