close: change parameters, defaults#2914
Merged
rustyrussell merged 3 commits intoAug 9, 2019
Merged
Conversation
We're about to change the API, so this makes the tests still work across the transition (and, as a bonus, tests our backwards compat shim). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ZmnSCPxj
reviewed
Aug 7, 2019
| @@ -241,7 +240,7 @@ def test_closing_different_fees(node_factory, bitcoind, executor): | |||
| # so increase the timeout so that this test will pass | |||
| # when valgrind is enabled. | |||
| # (close timeout defaults to 30 as of this writing) | |||
Contributor
There was a problem hiding this comment.
Maybe change the comment as well?
Contributor
Author
There was a problem hiding this comment.
Actually, changed the arg to 0, so it's infinite and no unilateral.
Contributor
There was a problem hiding this comment.
Latest commit-set seems to have skipped this use of close entirely?
Contributor
Author
There was a problem hiding this comment.
No, it eliminates it?
- # Now close all channels
- # All closes occur in parallel, and on Travis,
- # ALL those lightningd are running on a single core,
- # so increase the timeout so that this test will pass
- # when valgrind is enabled.
- # (close timeout defaults to 30 as of this writing)
- closes = [executor.submit(l1.rpc.close, p.channel, False, 90) for p in peers]
+ # Now close all channels (not unilaterally!)
+ closes = [executor.submit(l1.rpc.close, p.channel, 0) for p in peers]
Contributor
There was a problem hiding this comment.
Hmm, must have been some weirdness in github then. Okay.
ZmnSCPxj
suggested changes
Aug 7, 2019
`close` takes two optional arguments: `force` and `timeout`. `timeout` doesn't timeout the close (there's no way to do that), just the JSON call. `force` (default `false`) if set, means we unilaterally close at the timeout, instead of just failing. Timing out JSON calls is generally deprecated: that's the job of the client. And the semantics of this are confusing, even to me! A better API is a timeout which, if non-zero, is the time at which we give up and unilaterally close. The transition code is awkward, but we'll manage for the three releases until we can remove it. The new defaults are to unilaterally close after 48 hours. Fixes: ElementsProject#2791 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
370cf3b to
e7748a6
Compare
Only downside is you have to wait 1 second at least before unilaterally closing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
e7748a6 to
849e636
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #2791
Painful transition, but I think a long-term win for sane defaults.