faust icon indicating copy to clipboard operation
faust copied to clipboard

Issue: Autodiscovery error logs not showing up

Open blazing-gig opened this issue 3 years ago • 1 comments

Checklist

  • [x] I have included information about relevant versions
  • [x] I have verified that the issue persists when using the master branch of Faust.

Steps to reproduce

Start a Faust worker with autodiscovery enabled. Any import errors that occur during this process don't get logged to the console.

Expected behavior

Any import error that occurs during autodiscovery has to be logged/printed to the console at the very least.

Actual behavior

Import errors are not being logged/printed to the console

Full traceback

Paste the full traceback (if there is any)

Versions

  • Python version: 3.9.10
  • Faust version: 0.8.2
  • Operating system: MacOS Catalina
  • Kafka version: 6.2.0
  • RocksDB version (if applicable)

blazing-gig avatar Apr 01 '22 13:04 blazing-gig

I have a potential fix for this:

# module -> faust/worker.py

async def on_first_start(self) -> None:
        """Signal called the first time the worker starts.

        First time, means this callback is not called if the
        worker is restarted by an exception being raised.
        """
        self.change_workdir(self.workdir)
        # The order of execution of the following two lines have been swapped so that loggers are setup before the 
        # autodiscovery happens
        await self.default_on_first_start()
        self.autodiscover()

I've verified this as well. Let me knw if I'm missing something else I can raise a PR for the same.

blazing-gig avatar Apr 01 '22 13:04 blazing-gig

This looks pretty good! Please feel free to open a PR.

wbarnha avatar Sep 02 '22 15:09 wbarnha