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

TypeError: "object of type 'NoneType' has no len()" in asyncio.base_futures in _format_callbacks #7600

Closed
kozlovsky opened this issue Sep 18, 2023 · 2 comments
Assignees

Comments

@kozlovsky
Copy link
Contributor

kozlovsky commented Sep 18, 2023

Here:

def format_info(handle: Handle, include_stack: bool = False, stack_cut_duration: Optional[float] = None,
                limit: Optional[int] = None, enable_profiling_tip: bool = True) -> str:
    """
    Returns the representation of a task executed by asyncio, with or without the stack.
    """
    ...
    if not main_stack_tracking_is_enabled():
        stream = io.StringIO()
        task.print_stack(limit=limit, file=stream)  # <-- here

It looks like sometimes task.print_stack can crash with the task being investigated at the unfortunate moment. I think we should add a try/except block around the print_stack call to avoid it.

@kozlovsky kozlovsky added this to the 7.14.0 milestone Sep 18, 2023
@sentry-for-tribler
Copy link

Sentry issue: TRIBLER-1C1

kozlovsky added a commit to kozlovsky/tribler that referenced this issue Oct 2, 2023
kozlovsky added a commit to kozlovsky/tribler that referenced this issue Oct 2, 2023
@kozlovsky kozlovsky self-assigned this Oct 2, 2023
kozlovsky added a commit that referenced this issue Oct 2, 2023
…stack

Fixes #7600: handle exceptions in task.print_stack()
@kozlovsky
Copy link
Contributor Author

Fixed in #7614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant