- 
                Notifications
    You must be signed in to change notification settings 
- Fork 421
Doc and comment followups to #2562 #2591
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
          
     Merged
      
      
            tnull
  merged 5 commits into
  lightningdevkit:main
from
TheBlueMatt:2023-09-2562-followups
  
      
      
   
  Sep 29, 2023 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4abc939
              
                Correct test comments missed in f254c56585688a187a58dc284477cb1cd39
              
              
                TheBlueMatt 11b228b
              
                Correct ChannelUnavailable error docs on `send_payment_with_route`
              
              
                TheBlueMatt 974ba31
              
                Refer to an "outage" over a "timeout", for when failure happens
              
              
                TheBlueMatt 39094d4
              
                Correct comment in `shutdown_on_unfunded_channel`
              
              
                TheBlueMatt 34dd48c
              
                Add more details about async persistence completion/backgrounding
              
              
                TheBlueMatt File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is some inherent gap about how clients should or will implement async persist.
Imo, they might just start a thread or future, on completion just call channel_monitor_updated. (other method is queued messages)
In case of thread/future, if there is a failure inside of that, i don't expect them to be implementing "infinite retries in thread" for each InProgress monitor_update individually. (Whereas current documentation for async-persist seems to assume that)
Hence #2562 (comment)
Let me know if i misunderstand something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a future, I think they absolutely will retry infinitely in the task - there's very little overhead for the task and there's no reason to move to batching it. If they're doing a full OS thread, I agree, probably doesn't make sense to spawn a whole thread rather hopefully you simply notify an existing background thread. Still, I'm not quite sure what you're suggesting I change here - can you provide a concrete suggested phrasing change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I didn't feel it is alright to have many infinite retrying resources in system (that could be anything) if there is an outage or db failure. (But its ok, whatever it is.)
For Asynchronous persistence case,
We need to mention
Implementations should retry all pending persistence operations in the background with [`ChainMonitor::list_pending_monitor_updates`] and [`ChainMonitor::get_monitor`].Currently we mention this only for sync case in these docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For async users I kinda assume they dont do that polling but instead just spawn a task that
loop {}s forever.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can assume that, I think users will trip up on this. Since async has many different ways to be implemented and this is more related to failure handling in async.
We can have something like:
"
Implementations should either implement async persistence by retrying infinitely in a loop OR retry all pending persistence operations in the background using [
ChainMonitor::list_pending_monitor_updates] and [ChainMonitor::get_monitor]."