Global messages on 94632 timed out, restarting process, 95535 successfully terminated by `TERM` signal

I am on the Apple M1 Macbook pro. I have been trying to install discourse since morning and have reached bundle exec rails server in this tutorial Beginners Guide to Install Discourse on macOS for Development. I have been also trying to follow this tutorial: https://discuss.rubyonrails.org/t/tips-and-tricks-for-developing-rails-applications-on-apple-silicon/77089whenever I do bundle exec rails server (I have done it three times) it reaches a certain point and then it says “Global messages on 94632 timed out, restarting process, 95535 successfully terminated by ‘TERM’ signal”.

Here is the tail of logs during processing bundle exec rails server :

  MiniScheduler::Stat Create (5.6ms)  INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "live_slots_start", "started_at") VALUES ('Jobs::Heartbeat', 'Aashishs-MacBook-Pro.local', 94682, 1103494, '2021-07-30 11:03:52.271803') RETURNING "id"
  TRANSACTION (1.0ms)  COMMIT
  TRANSACTION (0.2ms)  BEGIN
  MiniScheduler::Stat Update (0.4ms)  UPDATE "scheduler_stats" SET "duration_ms" = 16, "live_slots_finish" = 1104793, "success" = TRUE WHERE "scheduler_stats"."id" = 1042
  TRANSACTION (1.6ms)  COMMIT
  TRANSACTION (0.4ms)  BEGIN
  MiniScheduler::Stat Create (6.0ms)  INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "live_slots_start", "started_at") VALUES ('Jobs::AboutStats', 'Aashishs-MacBook-Pro.local', 94682, 1109900, '2021-07-30 11:03:53.288729') RETURNING "id"
  TRANSACTION (7.1ms)  COMMIT
   (0.6ms)  SELECT COUNT(*) FROM "topics" WHERE "topics"."deleted_at" IS NULL AND (topics.archetype <> 'private_message')
   (0.3ms)  SELECT COUNT(*) FROM "topics" WHERE "topics"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND (created_at > '2021-07-29 11:03:53.314016')
   (1.4ms)  SELECT COUNT(*) FROM "topics" WHERE "topics"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND (created_at > '2021-07-23 11:03:53.319858')
   (0.2ms)  SELECT COUNT(*) FROM "topics" WHERE "topics"."deleted_at" IS NULL AND (topics.archetype <> 'private_message') AND (created_at > '2021-06-30 11:03:53.322501')
   (3.9ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."deleted_at" IS NULL
   (0.5ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."deleted_at" IS NULL AND (created_at > '2021-07-29 11:03:53.329111')
   (3.2ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."deleted_at" IS NULL AND (created_at > '2021-07-23 11:03:53.331193')
   (4.9ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."deleted_at" IS NULL AND (created_at > '2021-06-30 11:03:53.335365')
   (0.5ms)  SELECT COUNT(*) FROM "users" WHERE (users.id > 0) AND (NOT EXISTS(
                     SELECT 1
                     FROM anonymous_users a
                     WHERE a.user_id = users.id
                  ))
   (3.9ms)  SELECT COUNT(*) FROM "users" WHERE (users.id > 0) AND (NOT EXISTS(
                     SELECT 1
                     FROM anonymous_users a
                     WHERE a.user_id = users.id
                  )) AND (created_at > '2021-07-29 11:03:53.343462')
   (0.2ms)  SELECT COUNT(*) FROM "users" WHERE (users.id > 0) AND (NOT EXISTS(
                     SELECT 1
                     FROM anonymous_users a
                     WHERE a.user_id = users.id
                  )) AND (created_at > '2021-07-23 11:03:53.348895')
   (3.3ms)  SELECT COUNT(*) FROM "users" WHERE (users.id > 0) AND (NOT EXISTS(
                     SELECT 1
                     FROM anonymous_users a
                     WHERE a.user_id = users.id
                  )) AND (created_at > '2021-06-30 11:03:53.350098')
   (0.5ms)  SELECT COUNT(*) FROM "users" WHERE (last_seen_at > '2021-07-29 11:03:53.354731')
   (0.3ms)  SELECT COUNT(*) FROM "users" WHERE (last_seen_at > '2021-07-23 11:03:53.356296')
   (0.4ms)  SELECT COUNT(*) FROM "users" WHERE (last_seen_at > '2021-06-30 11:03:53.356908')
   (0.3ms)  SELECT COUNT(*) FROM "user_actions" WHERE "user_actions"."action_type" = 1
   (3.1ms)  SELECT COUNT(*) FROM "user_actions" WHERE "user_actions"."action_type" = 1 AND (created_at > '2021-07-29 11:03:53.358336')
   (0.4ms)  SELECT COUNT(*) FROM "user_actions" WHERE "user_actions"."action_type" = 1 AND (created_at > '2021-07-23 11:03:53.363013')
   (0.3ms)  SELECT COUNT(*) FROM "user_actions" WHERE "user_actions"."action_type" = 1 AND (created_at > '2021-06-30 11:03:53.364086')
  TRANSACTION (0.4ms)  BEGIN
  MiniScheduler::Stat Update (0.3ms)  UPDATE "scheduler_stats" SET "duration_ms" = 78, "live_slots_finish" = 1121121, "success" = TRUE WHERE "scheduler_stats"."id" = 1043
  TRANSACTION (0.2ms)  COMMIT
  TRANSACTION (0.2ms)  BEGIN
  MiniScheduler::Stat Create (5.7ms)  INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "live_slots_start", "started_at") VALUES ('Jobs::EnqueueDigestEmails', 'Aashishs-MacBook-Pro.local', 94682, 1124261, '2021-07-30 11:03:54.310194') RETURNING "id"
  TRANSACTION (1.1ms)  COMMIT
   (8.2ms)  SELECT "users"."id" FROM "users" INNER JOIN "user_options" ON "user_options"."user_id" = "users"."id" INNER JOIN "user_stats" ON "user_stats"."user_id" = "users"."id" INNER JOIN "user_emails" ON "user_emails"."user_id" = "users"."id" WHERE (users.id > 0) AND (NOT EXISTS(
                     SELECT 1
                     FROM anonymous_users a
                     WHERE a.user_id = users.id
                  )) AND "users"."active" = TRUE AND (suspended_till IS NULL OR suspended_till <= '2021-07-30 11:03:54.325622') AND "users"."staged" = FALSE AND (user_options.email_digests) AND (user_stats.bounce_score < 4) AND (user_emails.primary) AND (COALESCE(last_emailed_at, '2010-01-01') <= CURRENT_TIMESTAMP - ('1 MINUTE'::INTERVAL * user_options.digest_after_minutes)) AND (COALESCE(user_stats.digest_attempted_at, '2010-01-01') <= CURRENT_TIMESTAMP - ('1 MINUTE'::INTERVAL * user_options.digest_after_minutes)) AND (COALESCE(last_seen_at, '2010-01-01') <= CURRENT_TIMESTAMP - ('1 MINUTE'::INTERVAL * user_options.digest_after_minutes)) AND (COALESCE(last_seen_at, '2010-01-01') >= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * 365)) ORDER BY user_stats.digest_attempted_at ASC NULLS FIRST LIMIT 10000
  TRANSACTION (0.1ms)  BEGIN
  MiniScheduler::Stat Update (0.6ms)  UPDATE "scheduler_stats" SET "duration_ms" = 28, "live_slots_finish" = 1124171, "success" = TRUE WHERE "scheduler_stats"."id" = 1044
  TRANSACTION (3.9ms)  COMMIT
  TRANSACTION (0.2ms)  BEGIN
  MiniScheduler::Stat Create (8.4ms)  INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "live_slots_start", "started_at") VALUES ('Jobs::DashboardStats', 'Aashishs-MacBook-Pro.local', 94682, 1123939, '2021-07-30 11:03:55.326015') RETURNING "id"
  TRANSACTION (0.4ms)  COMMIT
  TRANSACTION (0.5ms)  BEGIN
  MiniScheduler::Stat Update (0.6ms)  UPDATE "scheduler_stats" SET "duration_ms" = 24, "live_slots_finish" = 1124040, "success" = TRUE WHERE "scheduler_stats"."id" = 1045
  TRANSACTION (0.8ms)  COMMIT
Global messages on 94632 timed out, restarting process
(base) aashishgangwani@Aashishs-MacBook-Pro discourse % 95535 successfully terminated by `TERM` signal.

As you can see in the end it says “Global messages on 94632 timed out, restarting the process, 95535 successfully terminated by ‘TERM’ signal”.

What does this error mean and how to resolve it?

I have tried loading message_bus using yarn add message_bus but that doesn’t resolve my issue.

I have also posted on stackoverflow but didn’t get any answers as of yet: ruby on rails - Global messages on 94632 timed out, restarting process, 95535 successfully terminated by `TERM` signal - Stack Overflow

1 Like

Can’t really help, but I think I’ve found the code, in Discourse’s message bus, in function new_subscriber_thread:

        if (Time.now - (@last_message || Time.now)) > keepalive_interval * 3
          logger.warn "Global messages on #{Process.pid} timed out, restarting process"
          # No other clean way to remove this thread, its listening on a socket
          #   no data is arriving
          #
          # In production we see this kind of situation ... sometimes ... when there is
          # a VRRP failover, or weird networking condition
1 Like

Thanks @Ed_S Hopefully we will reach somewhere with a solution for this one soon

1 Like

[Edit: oops, I see you are already following specific advice for running in macOS on M1]

1 Like

Thanks @Ed_S I followed your code snippet and changed the keepalive_interval *3 to keepalive_interval * 1000. and increased the time to keep it alive and it resolved the issue.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.