CASSANALYTICS-143 Fix various leaks in CDC caching and bridge implementation#189
CASSANALYTICS-143 Fix various leaks in CDC caching and bridge implementation#189jmckenzie-dev wants to merge 4 commits intoapache:trunkfrom
Conversation
…ntation Patch by Josh McKenzie; reviewed by TBD for CASSANALYTICS-143 This patch makes a lot of the lifecycle implementation in tests explicit (temp failes, cleanup of resources, etc) that previously relied on the CI env Just Working. Some of it is about tidying up and making explicit our position on resource management w/regards to test class lifecycle, and some of it is about leaks preventing GC (schema graph, etc).
|
|
||
| // Second call is idempotent — the flag stays true and no exception is thrown | ||
| CassandraBridgeFactory.maybeRegisterShutdownHook(); | ||
| assertThat(CassandraBridgeFactory.isShutdownHookRegistered()).isTrue(); |
There was a problem hiding this comment.
Would be helpful to have a test to verify close() is indeed clearing the cache.
There was a problem hiding this comment.
Good call; added both a method for external tests to confirm bridges are closed and a test that populates, confirm live, then closes and confirm closed. We don't necessarily introspect to ensure that the internal close runs actually succeeded (vs. the warn path on catch if they fail), but it at least indicates it went through that path and operated upon them.
There was a problem hiding this comment.
Do we still need this or can we remove it? This one is creating uncached classloader which is never closed.
|
LGTM, only minor comments |
| } | ||
| }); | ||
| COMMIT_LOG_DIRS.clear(); | ||
| CdcBridgeFactory.close(); |
There was a problem hiding this comment.
Don't we need to clear TypeCache here?
Patch by Josh McKenzie; reviewed by TBD for CASSANALYTICS-143
This patch makes a lot of the lifecycle implementation in tests explicit (temp fails, cleanup of resources, etc) that previously relied on the CI env Just Working. Some of it is about tidying up and making explicit our position on resource management w/regards to test class lifecycle, and some of it is about leaks preventing GC (schema graph, etc).