diff --git a/src/confluent_kafka/schema_registry/schema_registry_client.py b/src/confluent_kafka/schema_registry/schema_registry_client.py index ae6c55116..021e06427 100644 --- a/src/confluent_kafka/schema_registry/schema_registry_client.py +++ b/src/confluent_kafka/schema_registry/schema_registry_client.py @@ -222,8 +222,7 @@ def remove_by_subject(self, subject_name): Args: subject_name (str): Subject name the schema is registered under. """ - - + with self.lock: if subject_name in self.subject_schemas: for schema in self.subject_schemas[subject_name]: @@ -234,7 +233,6 @@ def remove_by_subject(self, subject_name): del self.subject_schemas[subject_name] - def get_schema(self, schema_id): """ Get the schema instance associated with schema_id from the cache. @@ -566,9 +564,9 @@ def delete_subject(self, subject_name, permanent=False): if permanent: self._rest_client.delete('subjects/{}?permanent=true' .format(_urlencode(subject_name))) - + self._cache.remove_by_subject(subject_name) - + return list def get_latest_version(self, subject_name):