Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

[CDEC-658] port to release/2.0.1 #3998

Merged
merged 4 commits into from
Jan 15, 2019
Merged

Conversation

avieth
Copy link
Contributor

@avieth avieth commented Jan 12, 2019

Cherry-picked merge commit.

3994: [CDEC-658] simplify threading in block streaming r=avieth a=avieth

If there is a connection problem causing the block streaming conversation to fail even to come up, then the retrieval worker will hang, because the block streaming TBQueue will never show StreamEnd: this is done in the finally clauses of the conversation callbacks themselves rather than the conversation at large (they never started in this case).

The solution in this pull request is to do the queue sourcing (retrieveBlocks) as well as the queue sinking (processBlocks) from within the conversation callback itself, by way of concurrently. If the conversation fails to even come up, then the exception will come through, and the retrieval worker will carry on.

A bit more detail on how this arose: it required a network failure while streaming blocks, rather than just fetching the next one, so it was a bit more rare than might be expected.

I'd like to make a test case for this, but it's difficult, because it requires a network failure at a particular moment. The node must be able to get the header announcements, but the network needs to go down as soon as it attempts to make a connection from streaming blocks.

The first two commits are not strictly related, but I had them around because I need them in order to build cardano-sl as a dependency. I can drop them if somebody really feels strongly that I should, but I'll need to merge them anyway.

https://iohk.myjetbrains.com/youtrack/issue/CDEC-658

Co-authored-by: Alexander Vieth [email protected]

Description

Linked issue

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

How to merge

Send the message bors r+ to merge this PR. For more information, see
docs/how-to/bors.md.

iohk-bors bot and others added 3 commits January 11, 2019 19:10
3994: [CDEC-658] simplify threading in block streaming r=avieth a=avieth

If there is a connection problem causing the block streaming conversation to fail even to come up, then the retrieval worker will hang, because the block streaming `TBQueue` will never show `StreamEnd`: this is done in the `finally` clauses of the conversation callbacks _themselves_ rather than the conversation at large (they never started in this case).

The solution in this pull request is to do the queue sourcing (`retrieveBlocks`) as well as the queue sinking (`processBlocks`) from within the conversation callback itself, by way of `concurrently`. If the conversation fails to even come up, then the exception will come through, and the retrieval worker will carry on.

A bit more detail on how this arose: it required a network failure while _streaming_ blocks, rather than just fetching the next one, so it was a bit more rare than might be expected.

I'd like to make a test case for this, but it's difficult, because it requires a network failure at a particular moment. The node must be able to get the header announcements, but the network needs to go down as soon as it attempts to make a connection from streaming blocks.

The first two commits are not strictly related, but I had them around because I need them in order to build cardano-sl as a dependency. I can drop them if somebody really feels strongly that I should, but I'll need to merge them anyway.

https://iohk.myjetbrains.com/youtrack/issue/CDEC-658

Co-authored-by: Alexander Vieth <[email protected]>
@avieth avieth requested review from coot and karknu January 14, 2019 19:42
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 14, 2019

Did you mean "r+"?

@avieth
Copy link
Contributor Author

avieth commented Jan 14, 2019

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 14, 2019

👎 Rejected by too few approved reviews

@avieth
Copy link
Contributor Author

avieth commented Jan 14, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 14, 2019
3998: [CDEC-658] port to release/2.0.1 r=avieth a=avieth

Cherry-picked merge commit.

3994: [CDEC-658] simplify threading in block streaming r=avieth a=avieth

If there is a connection problem causing the block streaming conversation to fail even to come up, then the retrieval worker will hang, because the block streaming `TBQueue` will never show `StreamEnd`: this is done in the `finally` clauses of the conversation callbacks _themselves_ rather than the conversation at large (they never started in this case).

The solution in this pull request is to do the queue sourcing (`retrieveBlocks`) as well as the queue sinking (`processBlocks`) from within the conversation callback itself, by way of `concurrently`. If the conversation fails to even come up, then the exception will come through, and the retrieval worker will carry on.

A bit more detail on how this arose: it required a network failure while _streaming_ blocks, rather than just fetching the next one, so it was a bit more rare than might be expected.

I'd like to make a test case for this, but it's difficult, because it requires a network failure at a particular moment. The node must be able to get the header announcements, but the network needs to go down as soon as it attempts to make a connection from streaming blocks.

The first two commits are not strictly related, but I had them around because I need them in order to build cardano-sl as a dependency. I can drop them if somebody really feels strongly that I should, but I'll need to merge them anyway.

https://iohk.myjetbrains.com/youtrack/issue/CDEC-658

Co-authored-by: Alexander Vieth <[email protected]>

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

## Linked issue

<!--- Put here the relevant issue from YouTrack -->



Co-authored-by: iohk-bors[bot] <iohk-bors[bot]@users.noreply.github.com>
Co-authored-by: Alexander Vieth <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 15, 2019

Timed out

@avieth
Copy link
Contributor Author

avieth commented Jan 15, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 15, 2019
3998: [CDEC-658] port to release/2.0.1 r=avieth a=avieth

Cherry-picked merge commit.

3994: [CDEC-658] simplify threading in block streaming r=avieth a=avieth

If there is a connection problem causing the block streaming conversation to fail even to come up, then the retrieval worker will hang, because the block streaming `TBQueue` will never show `StreamEnd`: this is done in the `finally` clauses of the conversation callbacks _themselves_ rather than the conversation at large (they never started in this case).

The solution in this pull request is to do the queue sourcing (`retrieveBlocks`) as well as the queue sinking (`processBlocks`) from within the conversation callback itself, by way of `concurrently`. If the conversation fails to even come up, then the exception will come through, and the retrieval worker will carry on.

A bit more detail on how this arose: it required a network failure while _streaming_ blocks, rather than just fetching the next one, so it was a bit more rare than might be expected.

I'd like to make a test case for this, but it's difficult, because it requires a network failure at a particular moment. The node must be able to get the header announcements, but the network needs to go down as soon as it attempts to make a connection from streaming blocks.

The first two commits are not strictly related, but I had them around because I need them in order to build cardano-sl as a dependency. I can drop them if somebody really feels strongly that I should, but I'll need to merge them anyway.

https://iohk.myjetbrains.com/youtrack/issue/CDEC-658

Co-authored-by: Alexander Vieth <[email protected]>

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

## Linked issue

<!--- Put here the relevant issue from YouTrack -->



Co-authored-by: iohk-bors[bot] <iohk-bors[bot]@users.noreply.github.com>
Co-authored-by: Alexander Vieth <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 15, 2019

Timed out

@disassembler
Copy link
Contributor

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 15, 2019
3998: [CDEC-658] port to release/2.0.1 r=disassembler a=avieth

Cherry-picked merge commit.

3994: [CDEC-658] simplify threading in block streaming r=avieth a=avieth

If there is a connection problem causing the block streaming conversation to fail even to come up, then the retrieval worker will hang, because the block streaming `TBQueue` will never show `StreamEnd`: this is done in the `finally` clauses of the conversation callbacks _themselves_ rather than the conversation at large (they never started in this case).

The solution in this pull request is to do the queue sourcing (`retrieveBlocks`) as well as the queue sinking (`processBlocks`) from within the conversation callback itself, by way of `concurrently`. If the conversation fails to even come up, then the exception will come through, and the retrieval worker will carry on.

A bit more detail on how this arose: it required a network failure while _streaming_ blocks, rather than just fetching the next one, so it was a bit more rare than might be expected.

I'd like to make a test case for this, but it's difficult, because it requires a network failure at a particular moment. The node must be able to get the header announcements, but the network needs to go down as soon as it attempts to make a connection from streaming blocks.

The first two commits are not strictly related, but I had them around because I need them in order to build cardano-sl as a dependency. I can drop them if somebody really feels strongly that I should, but I'll need to merge them anyway.

https://iohk.myjetbrains.com/youtrack/issue/CDEC-658

Co-authored-by: Alexander Vieth <[email protected]>

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

## Linked issue

<!--- Put here the relevant issue from YouTrack -->



Co-authored-by: iohk-bors[bot] <iohk-bors[bot]@users.noreply.github.com>
Co-authored-by: Alexander Vieth <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 15, 2019

@iohk-bors iohk-bors bot merged commit b8e8d8e into release/2.0.1 Jan 15, 2019
@iohk-bors iohk-bors bot deleted the avieth/2.0.1/cdec-658 branch January 15, 2019 20:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants