Skip to content

Commit

Permalink
[FLINK-3103] [runtime] Remove unnecessary synchronization in FsStateB…
Browse files Browse the repository at this point in the history
…ackend.FsCheckpointStateOutputStream

This closes 1474
  • Loading branch information
tedyu authored and StephanEwen committed Dec 23, 2015
1 parent c08bcf1 commit da751e8
Showing 1 changed file with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,22 +468,20 @@ public void flush() throws IOException {
*/
@Override
public void close() {
synchronized (this) {
if (!closed) {
closed = true;
if (outStream != null) {
if (!closed) {
closed = true;
if (outStream != null) {
try {
outStream.close();
fs.delete(statePath, false);

// attempt to delete the parent (will fail and be ignored if the parent has more files)
try {
outStream.close();
fs.delete(statePath, false);

// attempt to delete the parent (will fail and be ignored if the parent has more files)
try {
fs.delete(basePath, false);
} catch (IOException ignored) {}
}
catch (Exception e) {
LOG.warn("Cannot delete closed and discarded state stream for " + statePath, e);
}
fs.delete(basePath, false);
} catch (IOException ignored) {}
}
catch (Exception e) {
LOG.warn("Cannot delete closed and discarded state stream for " + statePath, e);
}
}
}
Expand Down

0 comments on commit da751e8

Please sign in to comment.