question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standalone broker on MacOS often fail to start after workstation sleep or reboot

See original GitHub issue

Describe the bug Often, but not always, if I start Pulsar standalone on my workstation and then close/reopen my laptop lid or restart the computer, subsequent attempts to start the standalone broker fail. The JVM process keeps running and emits some errors in its logs (see attachment), but never reaches a connectible state.

Repeatedly restarting the broker usually causes this condition to go away. Sometimes that doesn’t work, and I have to remove all broker data files (i.e. reinstall Pulsar) to make it start.

This only seems to happen when publishes have been recorded to a persistent topic.

This does not happen when using Pulsar Standalone in Docker, or on my Linux laptop. It appears to be MacOS specific.

To Reproduce

  1. brew install apache-pulsar
  2. brew services start apache-pulsar
  3. Verify that Pulsar is connectible on localhost:6650.
  4. Publish some messages to a persistent topic such that the message data and the topic itself are not automatically deleted (i.e. at least one ledger is created and persists).
  5. Close laptop lid or otherwise induce sleep.
  6. Reopen laptop and attempt to connect to Pulsar; it will sometimes fail.
  7. brew services restart apache-pulsar and attempt to connect to Pulsar; it will sometimes fail.

Expected behavior

  1. Sleep/resume should not break Pulsar. It should either be available after resumption, or the service/JVM process should fully crash so that it reports not-running if it cannot handle connection requests after resumption.
  2. Restarting the service should result in Pulsar either being connectible or not having a JVM process. If Pulsar Standalone can’t come up in a connectible state, its process shouldn’t hang around (if the process stays around, service managers think it’s still running and thus won’t report a failure or auto-restart it).

Desktop (please complete the following information):

  • OS: MacOS monterey, intel.
  • Pulsar standalone 2.9.2 and 2.9.1 both exhibit this issue.

Additional context brew services is likely not the problem. It doesn’t do anything special, and Pulsar does sometimes work when restarted via brew services.

Attached is a copy of my logs from a broker start attempt that did not become connectible after 5min. nostart.log

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
zbentleycommented, Jul 9, 2022

That seems to work, at least so far. Which of the broker.conf, proxy.conf, standalone.conf and bookkeeper.conf config files should I set advertisedAddress in for a standalone broker?

1reaction
zbentleycommented, Jul 8, 2022

@michaeljmarshall you may still be onto something; just because the IP in my logs is an RFC1918 address doesn’t mean it necessarily resolves to my host (or a router). I’ll try setting advertisedAddress; if that makes the problem disappear, I can check that into the Homebrew formula for Pulsar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Macbook Pro needs restart after sleep... - Apple Community
That's called a "kernal panic" and can be caused by many things. You can check the console log for clues (Utilities > Console)....
Read more >
How to Fix Mac Won't Wake from Sleep Issue after mac OS 11 ...
To do a hard shut down, press and hold the Power button until your Mac shuts down. After a few seconds of shutting...
Read more >
apache zookeeper - error while starting kafka broker
Today I started zookeeper and when I started kafka ( bin/kafka-server-start.sh config/server0.properties ), I get the following error. I tried various remedies ...
Read more >
What should you do if white screen of death appears?
Restart the computer to fix white screen of death. After running this simple command, start the operating system again. This often helps to ......
Read more >
Resolving Audio Interface Issues on Mac - Sweetwater
Run the driver installer and restart your computer. ... To save power, Macs will sleep their hard drive(s) when not in use.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found