Skip to content

Conversation

@GraciesPadre
Copy link
Contributor

This is a fix for https://jira.spectralogic.com/browse/JSDK-189

If a network transfer gets cut off before transferring all the data we ask for, retry the transfer by
creating a new set of blob ranges.

…doing so at that point is premature and prevents appending to the channel

during network-fault-induced retries.
… set when we experience the situation where the network delivers a smaller

payload than the http header says.
Creating a new GetObjectRequest per item transfer in a way that gives back the same channel for  like-named objects.
…into partial_read_bug

# Conflicts:
#	ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/IOUtils.java
… of the ranges to transfer in an attempt to provoke a failure that having a 0 offset would mask.
try (final InputStream responseStream = response.getResponseStream()) {
final long startTime = PerformanceUtils.getCurrentTime();
final long totalBytes = IOUtils.copy(responseStream, destinationChannel, bufferSize, objName, false);
destinationChannel.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an autogen file and should not be manually modified. If you need a change in an autogened file, let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Intellij hides the auto gen comment in the copyright notice. We can't close the channel in the response parser if we want to be able to resume an interrupted http transfer. The java sdk has this notion of an AutoCloseableCache that keeps track of channel lifetimes. Closing the channel here subverts the cache lifetime management.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. There may be a way around this. I'll need to run the java integration tests on sm25-2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Should be back to way it was.

…l repositioning logic, so that the autogen code can stay as

it is when we retry due to a network failure.
@rpmoore
Copy link
Contributor

rpmoore commented Dec 22, 2016

out of date

…into partial_read_bug

# Conflicts:
#	ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java
… mark a directory writable or not in favor of Process.waitFor().
private Long numBytesToTransfer;
private ImmutableCollection<Range> ranges;
private final AtomicLong destinationChannelOffset = new AtomicLong(0);
private final AtomicReference<ItemTransferrer> itemTransferrer = new AtomicReference<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really worried that this could be modified by multiple threads?

}

private void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final Throwable t) {
final FailureEvent failureEvent = new FailureEvent.Builder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to favor the syntax that guava uses for its builders. ie FailureEvent.builder() rather than new FailureEvent.Builder()

@rpmoore rpmoore merged commit f03fde1 into SpectraLogic:master Jan 9, 2017
@GraciesPadre GraciesPadre deleted the partial_read_bug branch January 9, 2017 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants