Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

added 502 to RETRY_HTTP_CODES

Pablo Hoffman7400ceb1ed97
diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst
index a33805c32..72ff1c979 100644
--- a/docs/topics/downloader-middleware.rst
+++ b/docs/topics/downloader-middleware.rst
@@ -724,7 +724,7 @@ Maximum number of times to retry, in addition to the first download.
RETRY_HTTP_CODES
^^^^^^^^^^^^^^^^
-Default: ``[500, 503, 504, 400, 408]``
+Default: ``[500, 502, 503, 504, 400, 408]``
Which HTTP response codes to retry. Other errors (DNS lookup issues,
connections lost, etc) are always retried.
diff --git a/scrapy/settings/default_settings.py b/scrapy/settings/default_settings.py
index 47e12174b..b03aac626 100644
--- a/scrapy/settings/default_settings.py
+++ b/scrapy/settings/default_settings.py
@@ -192,7 +192,7 @@ REFERER_ENABLED = True
RETRY_ENABLED = True
RETRY_TIMES = 2 # initial response + 2 retries = 3 requests
-RETRY_HTTP_CODES = [500, 503, 504, 400, 408]
+RETRY_HTTP_CODES = [500, 502, 503, 504, 400, 408]
RETRY_PRIORITY_ADJUST = -1
ROBOTSTXT_OBEY = False