openwhisk-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chetan Mehrotra <>
Subject ArtifactStore shutdown handling and shared resources
Date Thu, 21 Jun 2018 10:50:45 GMT
ArtifactStore SPI exposes a shutdown method which is responsible for
closing any resource owned by store implementation.

Ccurrently for CouchDbRestStore it only shuts down ActorMaterializer which
is created one per instance. It does not shutdown Http pool which is shared
across 3 store instance. This is documented in PoolingRestClient.

Now with CosmosDBArtifactStore we need to share a `DocumentClient` instance
which owns the underlying Netty connection pool. As all the store instance
talk to same db it makes sense to share the instance.

However this sharing poses problem with shutdown. To  handle that CosmosDB
PR introduces a `CountedReference` [1] which keeps an open/close count and
only closes when all references are closed.

Wanted to check with team if that would be fine approach to take?

Currently its bit tricky to manage components lifecycle and often we need
to rely on shutdown hooks to close the resources properly. May be we
revisit SPI/component lifecycle handling later and then review this
shutdown method handling

Chetan Mehrotra

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message