diff --git a/compute_endpoint/globus_compute_endpoint/executors/high_throughput/manager.py b/compute_endpoint/globus_compute_endpoint/executors/high_throughput/manager.py index 84131d2f3..53c102166 100755 --- a/compute_endpoint/globus_compute_endpoint/executors/high_throughput/manager.py +++ b/compute_endpoint/globus_compute_endpoint/executors/high_throughput/manager.py @@ -37,7 +37,6 @@ ) from globus_compute_endpoint.executors.high_throughput.worker_map import WorkerMap from globus_compute_endpoint.logging_config import ComputeLogger, setup_logging -from globus_compute_sdk.serialize import ComputeSerializer from parsl.version import VERSION as PARSL_VERSION RESULT_TAG = 10 @@ -241,7 +240,6 @@ def __init__( self.heartbeat_period = heartbeat_period self.heartbeat_threshold = heartbeat_threshold self.poll_period = poll_period - self.serializer = ComputeSerializer() self.next_worker_q: list[str] = [] # FIFO queue for spinning up workers. self.worker_procs: dict[str, subprocess.Popen] = {} diff --git a/compute_sdk/globus_compute_sdk/serialize/base.py b/compute_sdk/globus_compute_sdk/serialize/base.py index 118e49d44..dce72c019 100644 --- a/compute_sdk/globus_compute_sdk/serialize/base.py +++ b/compute_sdk/globus_compute_sdk/serialize/base.py @@ -1,19 +1,6 @@ from abc import ABCMeta, abstractmethod -class DeserializationError(Exception): - """Base class for all deserialization errors""" - - def __init__(self, reason): - self.reason = reason - - def __repr__(self): - return f"Deserialization failed due to {self.reason}" - - def __str__(self): - return self.__repr__() - - class SerializeBase(metaclass=ABCMeta): """Shared functionality for all serializer implementations""" @@ -37,14 +24,6 @@ def chomp(self, payload: str) -> str: ) return payload - def check(self, payload): - try: - x = self.serialize(payload) - self.deserialize(x) - - except Exception as e: - raise SerializerError(f"Serialize-Deserialize combo failed due to {e}") - @abstractmethod def serialize(self, data): raise NotImplementedError("Concrete class did not implement serialize") @@ -58,8 +37,15 @@ class SerializerError: def __init__(self, reason): self.reason = reason - def __str__(self): - return self.reason + def __repr__(self): + return f"Serialization failed due to {self.reason}" + + +class DeserializationError(Exception): + """Base class for all deserialization errors""" + + def __init__(self, reason): + self.reason = reason def __repr__(self): - return self.__str__() + return f"Deserialization failed due to {self.reason}" diff --git a/compute_sdk/globus_compute_sdk/serialize/concretes.py b/compute_sdk/globus_compute_sdk/serialize/concretes.py index 8e33edd23..03355f6f0 100644 --- a/compute_sdk/globus_compute_sdk/serialize/concretes.py +++ b/compute_sdk/globus_compute_sdk/serialize/concretes.py @@ -201,7 +201,7 @@ def deserialize(self, payload: str, variation: int = 0): """ Functions are serialized using the follow methods and the resulting encoded versions are stored. Redundancy if -one of the methods fail on deserlization, undetectable during +one of the methods fail on deserialization, undetectable during serialization attempts previously. Note that of the 3 categories of failures: