Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FAB-18132] Ch.Part.API: Remove ledger resources asynchronously #2027

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

stephyee
Copy link
Contributor

Type of change

  • New feature
  • Improvement (improvement to code, performance, etc)

Description

Removes ledger resources in asynchronously when channel participation APIs remove is called.

Related issues

FAB-18132

@stephyee
Copy link
Contributor Author

I noticed this change introduced a data races along with a few other bad things. Working on fixing this up.

@stephyee stephyee changed the title [FAB-18082] Ch.Part.API: Remove ledger resources asynchronously [FAB-18132] Ch.Part.API: Remove ledger resources asynchronously Oct 22, 2020
@stephyee stephyee force-pushed the fab-18132 branch 2 times, most recently from 192bda4 to 407e25f Compare October 23, 2020 23:43
@stephyee stephyee marked this pull request as ready for review October 27, 2020 15:23
@stephyee stephyee requested a review from a team as a code owner October 27, 2020 15:23
Copy link
Contributor

@wlahti wlahti left a comment

Choose a reason for hiding this comment

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

I'll do a more thorough review shortly, but for now, I noticed one spot in the tests that needs to be updated now that #2047 has been merged.

@stephyee stephyee force-pushed the fab-18132 branch 3 times, most recently from 0ecdd82 to 2d5ba70 Compare October 27, 2020 18:29
@stephyee stephyee force-pushed the fab-18132 branch 2 times, most recently from b0ced9d to 2d6a499 Compare October 28, 2020 16:28
@stephyee stephyee force-pushed the fab-18132 branch 3 times, most recently from ff8a247 to 521cd50 Compare October 29, 2020 18:19
@stephyee stephyee force-pushed the fab-18132 branch 3 times, most recently from 844330d to 59908f3 Compare October 30, 2020 20:24
@stephyee stephyee force-pushed the fab-18132 branch 2 times, most recently from 0ccd4ed to b1e3ea5 Compare October 30, 2020 21:32
@stephyee stephyee marked this pull request as draft November 2, 2020 13:10
@stephyee
Copy link
Contributor Author

stephyee commented Nov 4, 2020

@tock-ibm will do, first I need to clean up some flakiness with the int test.

@stephyee stephyee marked this pull request as ready for review November 4, 2020 19:10
tock-ibm
tock-ibm previously approved these changes Nov 5, 2020
@tock-ibm
Copy link
Contributor

tock-ibm commented Nov 5, 2020

Looks good to me.
I added one minor comment for adding a test case for remove, but lets tackle it in another PR.

Copy link
Contributor

@wlahti wlahti left a comment

Choose a reason for hiding this comment

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

This PR now needs a rebase/rename for the "member" -> "consenter" change I noted. Sorry! That one was merged surprisingly quickly...

Copy link
Contributor

@wlahti wlahti left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks, Tiffany!

@tock-ibm
Copy link
Contributor

tock-ibm commented Nov 6, 2020

Looks good to me.

@hyperledger hyperledger deleted a comment from stephyee Nov 6, 2020
r.pendingRemoval[channelID] = true

go func() {
if err := r.ledgerFactory.Remove(channelID); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we make this simpler?

err := r.ledgerFactory.Remove(channelID)
r.lock.Lock()
defer r.lock.Unlock()
if err != nil { 
.... 
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

very much so yes - I'll handle in a follow-up.

if removalStatus {
return types.ErrChannelPendingRemoval
} else {
return types.ErrChannelRemovalFailure
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we "try again"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe #2027 (comment) this should only apply to the Joining a channel that experienced a removal failure.

Copy link
Contributor

@yacovm yacovm left a comment

Choose a reason for hiding this comment

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

Let's address in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants