Repository: dmwm/wmcore
Issue: DBS3Upload crashing with a operation time out

**Impact of the bug**
WMAgent

**Describe the bug**
Same as #9396 , just the error message is different:
```
Message: Unknown failure while fetching parentage map from WMStats. Error: (28, 'Operation timed out after 270001 milliseconds with 0 bytes received')
```

**How to reproduce it**
Not sure yet, since it got implemented, there were random wmstats requests taking a long time. Might be some overload on the CMSWEB side, or a bad backend, or busy couch (but this one very unlikely!)

**Expected behavior**
Not crash, create a LogDB entry and skip the cycle.

**Additional context and error message**
Full traceback in:
```
2019-10-18 16:00:36,298:140150170158848:INFO:DBSUploadPoller:Starting the DBSUpload Polling Cycle
2019-10-18 16:05:06,419:140150170158848:ERROR:BaseWorkerThread:Error in worker algorithm (1):
Backtrace:
  <WMComponent.DBS3Buffer.DBSUploadPoller.DBSUploadPoller object at 0x7f7741427250> <@========== WMException Start ==========@>
Exception Class: DBSUploadException
Message: Unknown failure while fetching parentage map from WMStats. Error: (28, 'Operation timed out after 270001 milliseconds with 0 bytes received')
        ModuleName : WMComponent.DBS3Buffer.DBSUploadPoller
        MethodName : updateDatasetParentageCache
        ClassInstance : None
        FileName : /data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMComponent/DBS3Buffer/DBSUploadPoller.py
        ClassName : None
        LineNumber : 358
        ErrorNr : 0

Traceback: 
  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMComponent/DBS3Buffer/DBSUploadPoller.py", line 342, in updateDatasetParentageCache
    self.datasetParentageCache = self.wmstatsServerSvc.getChildParentDatasetMap()

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/WMStatsServer/WMStatsServer.py", line 105, in getChildParentDatasetMap
    results = self.getFilteredActiveData(filter, mask)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/WMStatsServer/WMStatsServer.py", line 92, in getFilteredActiveData
    return self._getResult(callname, verb="GET")

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/WMStatsServer/WMStatsServer.py", line 43, in _getResult
    verb=verb, contentType=contentType)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/Service.py", line 205, in refreshCache
    self.getData(cachefile, url, inputdata, incoming_headers, encoder, decoder, verb, contentType)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/Service.py", line 282, in getData
    contentType=contentType)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/Requests.py", line 153, in makeRequest
    result = self.makeRequest_pycurl(uri, data, verb, incoming_headers, contentType)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/Requests.py", line 178, in makeRequest_pycurl
    ckey=ckey, cert=cert, capath=capath, decode=True)

  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Services/pycurl_manager.py", line 240, in request
    curl.perform()

<@---------- WMException End ----------@>  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/WorkerThreads/BaseWorkerThread.py", line 182, in __call__
    tSpent, results, _ = algorithmWithDBExceptionHandler(parameters)
  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMCore/Database/DBExceptionHandler.py", line 39, in wrapper
    return f(*args, **kwargs)
  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/Utils/Timers.py", line 24, in wrapper
    res = func(*arg, **kw)
  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMComponent/DBS3Buffer/DBSUploadPoller.py", line 311, in algorithm
    if self.updateDatasetParentageCache() is False:
  File "/data/srv/wmagent/v1.2.6.patch1/sw/slc7_amd64_gcc630/cms/wmagent/1.2.6.patch1/lib/python2.7/site-packages/WMComponent/DBS3Buffer/DBSUploadPoller.py", line 358, in updateDatasetParentageCache
    raise DBSUploadException(msg)

2019-10-18 16:05:06,419:140150170158848:INFO:Harness:>>>Terminating worker threads
```


Changed files:
src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py

diff --git a/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py b/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py
index 7e00146f3..57d62f6a4 100644
--- a/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py
+++ b/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py
@@ -349,9 +349,7 @@ class DBSUploadPoller(BaseWorkerThread):
                 pass
             elif 'Connection refused' in str(ex):
                 msg += 'Error: %s' % str(ex)
-            elif 'The read operation timed out' in str(ex):
-                msg += 'Error: %s' % str(ex)
-            elif 'Connection timed out' in str(ex):
+            elif 'timed out' in str(ex):
                 msg += 'Error: %s' % str(ex)
             else:
                 msg = "Unknown failure while fetching parentage map from WMStats. Error: %s" % str(ex)