[
https://issues.apache.org/jira/browse/BEAM-7948?focusedWorklogId=346212&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-346212
]
ASF GitHub Bot logged work on BEAM-7948:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Nov/19 19:33
Start Date: 19/Nov/19 19:33
Worklog Time Spent: 10m
Work Description: lukecwik commented on pull request #9949: [BEAM-7948]
Add time-based cache threshold support in the Java data s…
URL: https://github.com/apache/beam/pull/9949#discussion_r348124586
##########
File path:
sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/data/BeamFnDataTimeBasedBufferingOutboundObserver.java
##########
@@ -90,20 +90,27 @@ private void periodicFlush() {
try {
flush();
} catch (Throwable t) {
- if (t instanceof IOException) {
- flushException.set((IOException) t);
- } else {
- flushException.set(new IOException(t));
- }
throw new RuntimeException(t);
}
}
/** Check if the flush thread failed with an exception. */
private void checkFlushThreadException() throws IOException {
- IOException e = flushException.get();
- if (e != null) {
- throw e;
+ if (flushFuture.isDone()) {
+ try {
+ flushFuture.get();
+ throw new IOException("Periodic flushing thread finished
unexpectedly.");
+ } catch (ExecutionException ee) {
+ // the cause of ExecutionException is always RuntimeException
+ RuntimeException re = (RuntimeException) ee.getCause();
+ if (re.getCause() instanceof IOException) {
+ throw (IOException) re.getCause();
+ }
+ throw re;
+ } catch (InterruptedException | CancellationException e) {
+ // Should never happen
Review comment:
Prefer to wrap the InerruptedException and CancellationException in an
IOException.
Also for the interrupted exception you should invoke Thread.interrupt()
before rethrowing.
----------------------------------------------------------------
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: 346212)
Time Spent: 2.5h (was: 2h 20m)
> Add time-based cache threshold support in the Java data service
> ---------------------------------------------------------------
>
> Key: BEAM-7948
> URL: https://issues.apache.org/jira/browse/BEAM-7948
> Project: Beam
> Issue Type: Sub-task
> Components: java-fn-execution
> Reporter: sunjincheng
> Assignee: sunjincheng
> Priority: Major
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> Currently only size-based cache threshold is supported in data service. It
> should also support the time-based cache threshold. This is very important,
> especially for streaming jobs which are sensitive to the delay.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)