Abacn commented on code in PR #36365:
URL: https://github.com/apache/beam/pull/36365#discussion_r2402069753


##########
sdks/python/apache_beam/utils/subprocess_server.py:
##########
@@ -465,9 +466,41 @@ def local_jar(cls, url, cache_dir=None, user_agent=None):
             # is already moved. Safe to ignore.
             pass
         except URLError as e:
-          raise RuntimeError(
-              f'Unable to fetch remote job server jar at {url}: {e}. If no '
-              f'Internet access at runtime, stage the jar at {cached_jar}')
+          # Try Google Maven mirror as fallback if the original URL is from
+          # Maven Central
+          if cls.MAVEN_CENTRAL_REPOSITORY in url:
+            fallback_url = url.replace(
+                cls.MAVEN_CENTRAL_REPOSITORY, cls.GOOGLE_MAVEN_MIRROR)
+            _LOGGER.info(
+                'Trying Google Maven mirror fallback: %s' % fallback_url)
+            try:
+              if user_agent is None:

Review Comment:
   These are duplicate code as above. We can put downloading logic into a 
local/static method (and subsequent support maven repo override can be based on 
this)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to