[
https://issues.apache.org/jira/browse/GOBBLIN-1034?focusedWorklogId=379116&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-379116
]
ASF GitHub Bot logged work on GOBBLIN-1034:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jan/20 01:28
Start Date: 30/Jan/20 01:28
Worklog Time Spent: 10m
Work Description: sv2000 commented on pull request #2876: GOBBLIN-1034:
Ensure underlying writers are expired from the Partitio…
URL: https://github.com/apache/incubator-gobblin/pull/2876#discussion_r372719715
##########
File path:
gobblin-core/src/test/java/org/apache/gobblin/writer/PartitionedWriterTest.java
##########
@@ -176,4 +165,31 @@ public void testControlMessageHandler() throws
IOException {
writer.close();
}
+
+ @Test
+ public void testPartitionWriterCacheRemovalListener()
+ throws IOException, InterruptedException {
+ State state = new State();
+ state.setProp(ConfigurationKeys.WRITER_PARTITIONER_CLASS,
TestPartitioner.class.getCanonicalName());
+ state.setProp(PartitionedDataWriter.PARTITIONED_WRITER_CACHE_TTL_SECONDS,
1);
+ TestPartitionAwareWriterBuilder builder = new
TestPartitionAwareWriterBuilder();
+
+ PartitionedDataWriter writer = new PartitionedDataWriter<String,
String>(builder, state);
+
+ String record1 = "abc";
+ writer.writeEnvelope(new RecordEnvelope(record1));
+
+ String record2 = "123";
+ writer.writeEnvelope(new RecordEnvelope(record2));
+
+ //Sleep for more than cache expiration interval
+ Thread.sleep(1500);
Review comment:
Guava does provide Ticker interface for testing cache evictions without
having to put sleeps. Unfortunately, the cache has to be built with the ticker,
which is not what we want for our test. In our test, since we explicitly call
cache cleanup(), we should not encounter the issue you are describing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 379116)
Time Spent: 1h 10m (was: 1h)
> Ensure underlying writers are expired from the PartitionedDataWriter cache to
> avoid accumulation of writers for long running Gobblin jobs
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: GOBBLIN-1034
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1034
> Project: Apache Gobblin
> Issue Type: Improvement
> Components: gobblin-core
> Affects Versions: 0.15.0
> Reporter: Sudarshan Vasudevan
> Assignee: Abhishek Tiwari
> Priority: Major
> Fix For: 0.15.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Currently, the underlying writers are never evicted from the
> PartitionedDataWriter cache. For long running Gobblin jobs (e.g. streaming),
> this will cause a memory leak particularly if the underlying writers maintain
> state.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)