Code Monkey home page Code Monkey logo

Comments (11)

martindurant avatar martindurant commented on June 2, 2024

797/800 isn't bad :)
Interesting that this seems to happen during ls. Yes, agree that there could be some retry logic for anything within _call. Would you be interested in implementing this and submitting a PR?

from gcsfs.

jean-philippe-martin avatar jean-philippe-martin commented on June 2, 2024

I agree it's not that bad - especially since I think I opened a few more files, so it's closer to 1000.

Since you're open to it, yes, I can try my hand at a PR. Can't guarantee it'll come today though.

from gcsfs.

martindurant avatar martindurant commented on June 2, 2024

The try/retry should go around this line: https://github.com/dask/gcsfs/blob/master/gcsfs/core.py#L298

from gcsfs.

martindurant avatar martindurant commented on June 2, 2024

OK to close?

from gcsfs.

jean-philippe-martin avatar jean-philippe-martin commented on June 2, 2024

Absolutely!

from gcsfs.

yan-hic avatar yan-hic commented on June 2, 2024

@martindurant can you reopen the issue ?

I was misled in thinking that error 104 was not caught as retriable but it is the logging of it that is confusing, especially when one looks at Stackdriver logging - we use gcsfs in Cloud Functions.

In particular:

        logger.exception("_call exception: %s", e)
            if retry == self.retries - 1:
                raise e
            if is_retriable(e):
                # retry
                continue
            raise e

If retriable, would we want to log as an exception ? Warning no good for us as this is mapped to Error in SD logging too.

I would remove the logging.exception and add a logging.info in the is_retriable block instead.

from gcsfs.

martindurant avatar martindurant commented on June 2, 2024

How about:

--- a/gcsfs/core.py
+++ b/gcsfs/core.py
@@ -467,12 +467,13 @@ class GCSFileSystem(object):
                 validate_response(r, path)
                 break
             except (HtmlError, RequestException, GoogleAuthError) as e:
-                logger.exception("_call exception: %s", e)
                 if retry == self.retries - 1:
+                    logger.exception("_call out of retries on exception: %s", e)
                     raise e
                 if is_retriable(e):
-                    # retry
+                    logger.debug("_call retrying after exception: %s", e)
                     continue
+                logger.exception("_call non-retriable exception: %s", e)
                 raise e
         try:

from gcsfs.

yan-hic avatar yan-hic commented on June 2, 2024

Very good ! The more - "switchable" - info the better !

from gcsfs.

yan-hic avatar yan-hic commented on June 2, 2024

@martindurant Can you reopen the issue to include your latest code proposal ?

from gcsfs.

martindurant avatar martindurant commented on June 2, 2024

This change was made in 323ac55 ( https://github.com/dask/gcsfs/blob/master/gcsfs/core.py#L474 )

from gcsfs.

yan-hic avatar yan-hic commented on June 2, 2024

Thx ! Had missed that.

from gcsfs.

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.