Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dbproxy_superficial…
Browse files Browse the repository at this point in the history
…_cleanup
  • Loading branch information
fbarreir committed Nov 4, 2024
2 parents 5629e06 + 1b0e73f commit 1239fd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
17 changes: 1 addition & 16 deletions pandaserver/configurator/Configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def __init__(self, taskBuffer, log_stream=None):
if hasattr(panda_config, "NWS_URL"):
self.NWS_URL = panda_config.NWS_URL
else:
self.NWS_URL = "http://atlas-adc-netmetrics-lb.cern.ch/metrics/latest.json"
self.NWS_URL = "https://atlas-rucio-network-metrics.cern.ch/metrics.json"

if hasattr(panda_config, "CRIC_URL_CM"):
self.CRIC_URL_CM = panda_config.CRIC_URL_CM
Expand Down Expand Up @@ -705,21 +705,6 @@ def process_nws_dump(self):
except KeyError:
pass

# PerfSonar latency and packetloss
for metric in [LATENCY, PACKETLOSS]:
try:
struc = self.nws_dump[src_dst][metric]
try:
updated_at = datetime.strptime(struc[TIMESTAMP], "%Y-%m-%dT%H:%M:%S")
if updated_at > latest_validity:
value = struc[LATEST]
data.append((source, destination, metric, value, updated_at))
except KeyError:
self.log_stream.debug(f"Entry {struc} ({source}->{destination}) does not follow {metric} standards")
pass
except KeyError:
continue

return data

def process_CRIC_cm_dump(self):
Expand Down
15 changes: 8 additions & 7 deletions pandaserver/taskbuffer/OraDBProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8993,19 +8993,19 @@ def _rollback(self, useOtherError=False):
_logger.debug("rollback")
try:
self.conn.rollback()
except Exception as e:
except Exception:
_logger.error("rollback error")
# get error code from
return_value = False
# reconnect if needed
try:
err_type, err_value = sys.exc_info()[:2]
# get error code for postgres
if self.backend == "postgres":
try:
err_code = e.pgcode
err_code = err_value.pgcode
except Exception:
pass
return_value = False
# reconnect if needed
try:
# get ORA ErrorCode
err_type, err_value = sys.exc_info()[:2]
if err_code is None:
err_code = str(err_value).split()[0]
err_code = err_code[:-1]
Expand Down Expand Up @@ -9036,6 +9036,7 @@ def _rollback(self, useOtherError=False):
psycopg_errorcodes.CONNECTION_DOES_NOT_EXIST,
psycopg_errorcodes.SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION,
psycopg_errorcodes.CONNECTION_FAILURE,
psycopg_errorcodes.READ_ONLY_SQL_TRANSACTION,
]
else:
# mysql error codes for connection error
Expand Down
2 changes: 2 additions & 0 deletions pandaserver/taskbuffer/WrappedCursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def initialize(self):
self.conn.set_client_encoding("UTF-8")
# TZ
self.execute("SET timezone=0")
# commit to set session params permanently
self.conn.commit()
else:
# get hostname
self.execute("SELECT SUBSTRING_INDEX(USER(),'@',-1)")
Expand Down

0 comments on commit 1239fd3

Please sign in to comment.