Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code capture for Prefect workflows is very noisy #8526

Closed
crusaderky opened this issue Feb 26, 2024 · 0 comments · Fixed by #8532
Closed

Code capture for Prefect workflows is very noisy #8526

crusaderky opened this issue Feb 26, 2024 · 0 comments · Fixed by #8532
Labels
good first issue Clearly described and easy to accomplish. Good for beginners to the project. p3 Affects a small number of users or is largely cosmetic

Comments

@crusaderky
Copy link
Collaborator

crusaderky commented Feb 26, 2024

The code frames captured for Prefect workflows are mostly meaningless stack frames of /opt/coiled/env/lib/python3.11/threading.py which should be filtered out.

https://cloud.coiled.io/clusters/387906/information?viewedAccount=%22dask-engineering%22&tab=Code&computation=

@task(
    log_prints=True,
    retries=10,
    retry_delay_seconds=exponential_backoff(10),
    retry_jitter_factor=1,
)
@coiled.function(
    # snip - useful info
)
def json_file_to_parquet(file):
    """Convert raw JSON data file to Parquet."""
    # snip - useful info

/opt/coiled/env/lib/python3.11/threading.py
    def _bootstrap_inner(self):
        try:
            self._set_ident()
            self._set_tstate_lock()
            if _HAVE_THREAD_NATIVE_ID:
                self._set_native_id()
            self._started.set()
            with _active_limbo_lock:
                _active[self._ident] = self
                del _limbo[self]

            if _trace_hook:
                _sys.settrace(_trace_hook)
            if _profile_hook:
                _sys.setprofile(_profile_hook)

            try:
                self.run()
            except:
                self._invoke_excepthook(self)
        finally:
            self._delete()

/opt/coiled/env/lib/python3.11/threading.py
    def run(self):
        """Method representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        """
        try:
            if self._target is not None:
                self._target(*self._args, **self._kwargs)
        finally:
            # Avoid a refcycle if the thread is running a function with
            # an argument that has a member that points to the thread.
            del self._target, self._args, self._kwargs

This is adjacent to

@crusaderky crusaderky added good first issue Clearly described and easy to accomplish. Good for beginners to the project. p3 Affects a small number of users or is largely cosmetic labels Feb 26, 2024
@crusaderky crusaderky changed the title Code captrue for Prefect workflows is very noisy Code capture for Prefect workflows is very noisy Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Clearly described and easy to accomplish. Good for beginners to the project. p3 Affects a small number of users or is largely cosmetic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant