How to know if message bus is still active

AI-generated summary

pfaffman is experiencing issues with a status page that uses the message bus to provide updates during a Discourse rebuild process. The page appears to stop receiving updates after a period of inactivity, and pfaffman wonders if the message bus times out.

sam suggests that the message bus recovers from broken connections and that the issue might be related to the channel name changing on page reload.

After further discussion, pfaffman realizes that the problem might not be with the message bus timing out, but rather with an incorrect push to the message bus. sam explains that the message bus backs off in case of failures, which might have contributed to the issue.

Ultimately, pfaffman concludes that the problem was not with the message bus stopping to listen, but rather with their own misunderstanding of the issue.

I’m working on this plugin that does Discourse rebuilds. It’s pretty darn close. The thing that’s bugging me now is that I have a status page that gives updates as things happen in the upgrade. But it takes a long time and (I think) eventually the message bus times out because there’s no activity on the page. If the user navigates away and back to the page it works fine.

Is there a way to fix this? Maybe put something in the page that will do a reload every 5 minutes or something like that?

MessageBus recovers from broken connections, etc, maybe your channel name changes on reload?

So MessageBus should keep updating a page forever, even if the browser is idle? What does REQUEST_QUEUE_SECONDS do? (Oh, it’s only if the server is flooded?)

But . . . it looks like maybe my problem had to do with something getting pushed to MessageBus that shouldn’t have. WIth Rails, Ember, and Ansible all at play, it’s hard for me to know who to blame. :man_shrugging:

The more message bus fails, the more it backs off:

Maybe you were in a situation where it was failing for a huge amount of time and then the backoff just got too big for you.

Hmm. No. I think I just didn’t understand at all what my problem was. From the beginning I was sure that it just stopped listening at some point, but I was wrong. Thanks very much. I really appreciate it.