Giter Club home page Giter Club logo

Comments (7)

Qix- avatar Qix- commented on June 9, 2024 1

Might be an endless loop while formatting. I'm going to be pretty busy the next few weeks but will try to take a look for you.

Thank you for the repro case, that's super helpful :)

from better-exceptions.

Delgan avatar Delgan commented on June 9, 2024 1

So, better_exceptions is hanging here.

Prepend the format_value function with:

if getattr(v, '__name__', None) == '_get':
    help(v)
    print("The program will crash...")
print("v =", v)

And then...
1504718117-screenshot

Strangely, it is not possible to display the method.

My traceback is slightly different from yours.
The first line is result[0] = yield gen.maybe_future(func(*args, **kwargs)).
It appears that this func function is actually the _get method which cannot be displayed.
This is why it prevents better_exceptions to format the traceback.
The function make_coro of your traceback appears with v1.16.2 and uses func too.
There is no error with TBVaccine because it does not introspect this traceback.

I then tried to study the code of distributed but wow... It is a little bit too complex for me.
It is perhaps related to this __str__ function.
In the end, it looks like the bug came from distributed and not better_exceptions.
The bug stopped occurring with v1.17.0 when they removed the _get function.
However, I am not sure that the bug has completely disappeared.
Maybe it has just been moved, and that the snippet here does not show it anymore.

from better-exceptions.

frol avatar frol commented on June 9, 2024

@Qix- Any ideas? I have just noticed TBVaccine project and its hook works well with Dask Distributed...

@skorokithakis Thank you for mentioning TBVaccine! It works great for me where better-exceptions just breaks things.

from better-exceptions.

Delgan avatar Delgan commented on June 9, 2024

@frol Hi!

I wanted to work on this issue but unfortunately I can not reproduce the error.
Are you still able to reproduce it?

If so, some information about your configuration may be usefull: distribution, libraries versions (run pip freeze), python version (run python --version).

I have studied the source code a bit and I do not see where there could be an infinite loop.

Sometimes your snippet takes a long time to run but the error always appears in the end (although I do not see any logging messages), with or without better_exceptions imported.

from better-exceptions.

frol avatar frol commented on June 9, 2024

@Delgan Either dask or distributed has changed something so it works fine now with the latest versions of those. Downgrading pip install dask==0.14.3 distributed==1.16.1 makes the issue reproducible.

from better-exceptions.

Delgan avatar Delgan commented on June 9, 2024

@frol Indeed, I can reproduce the error now, thank you!

from better-exceptions.

Qix- avatar Qix- commented on June 9, 2024

I hold pretty firm with the idea that performing any I/O in __str__ or __repr__ is an anti-pattern and definitely not a use-case we should bend over backwards for.

Sounds like it got resolved in a successive release - going to close. Let me know if this is still a problem for anyone.

Keep in mind, tbvaccine doesn't do all of the stuff we do. It's not that tbvaccine is any better or worse than better-exceptions, it's just that we hit more codepaths than they do, increasing surface area for bugs like this to manifest.

from better-exceptions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.