File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -232,15 +232,14 @@ def is_monitoring_enabled(self) -> bool:
232232 def close (self ):
233233 """
234234 Close the wrapper and stop the repeating task poller if it's running.
235- This is called by Store. close() during shutdown to ensure the poller thread is stopped .
235+ Also forwards the close call to the underlying store if it has a close method .
236236 """
237- poller_to_stop = None
238237 with self .__lock .write ():
239- poller_to_stop = self .__poller
240- self .__poller = None
241-
242- if poller_to_stop is not None :
243- poller_to_stop . stop ()
238+ if self .__poller is not None :
239+ self .__poller . stop ()
240+ self . __poller = None
241+ if hasattr ( self . store , "close" ) :
242+ self . store . close ()
244243
245244
246245class FDv2 (DataSystem ):
Original file line number Diff line number Diff line change @@ -189,6 +189,28 @@ def initialized(self) -> bool:
189189 # :return: true if the underlying data store is reachable
190190 # """
191191
192+ # WARN: This isn't a required method on a FeatureStore. The SDK will
193+ # check if the provided store responds to this method, and if it does,
194+ # will call it during shutdown to release any resources (such as database
195+ # connections or connection pools) that the store may be using.
196+ #
197+ # @abstractmethod
198+ # def close(self):
199+ # """
200+ # Releases any resources used by the data store implementation.
201+ #
202+ # This method will be called by the SDK during shutdown to ensure proper
203+ # cleanup of resources such as database connections, connection pools,
204+ # network sockets, or other resources that should be explicitly released.
205+ #
206+ # Implementations should be idempotent - calling close() multiple times
207+ # should be safe and have no additional effect after the first call.
208+ #
209+ # This is particularly important for persistent data stores that maintain
210+ # connection pools or other long-lived resources that should be properly
211+ # cleaned up when the SDK is shut down.
212+ # """
213+
192214
193215class FeatureStoreCore :
194216 """
You can’t perform that action at this time.
0 commit comments