- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Allow disabling fsync on log rotate and pod shutdown #8363
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
Allow disabling fsync on log rotate and pod shutdown #8363
Conversation
Signed-off-by: René Treffer <[email protected]>
| Hi @rtreffer. Thanks for your PR. I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with  Once the patch is verified, the new status will be reflected by the  I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. | 
        
          
                pkg/config/config.go
              
                Outdated
          
        
      |  | ||
| // NoSyncLog if enabled will disable fsync on log rotation and container exit. | ||
| // This can improve performance but may result in date loss on hard system crashes. | ||
| NoSyncLog bool `toml:"no_sync_log"` | 
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.
@cri-o/cri-o-maintainers I wonder if this should be a member of the runtime config structure, as it doesn't work for runtime pod or vm right now
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 just checked other log related settings in this struct and they seem to have mixed scopes as well
- LogSizeMaxseems to apply to oci and pod
- LogToJournaldseems to apply to oci only
Would it be acceptable to document this correctly?
E.g. appending Applies to oci containers only to all doc strings for the setting?
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.
We have, indeed, overloaded RuntimeConfig a little bit. I still am of a belief that LogLevel should not be there, for example. I suppose it was also done with some of the options for convenience since it's easier to access some of these depending on which objects are being passed around...
@haircommander, I think it would be fine... for now. We then can figure out how to clean this up.
Thoughts?
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.
sorry by runtime config I mean crio.runtime.runtimes runtime (talk about overloaded!) . this only works for runtime type OCI, and I'd love to see it as a member there instead
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.
Ah, ok, so
- Move it to RuntimeHandler
- Add validation that it only applies to OCI
The thing I haven't figured out is what to do about the cli option in that case.
But I'll update this PR once I get that sorted.
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 personaly don't think the cli option is needed. Do you really want it @rtreffer ?
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.
Well, it was convinient, but looks like it might be annoying to expose it as a flag, so I am in favor of dropping it for simplicity.
| /ok-to-test | 
| Codecov ReportAttention: Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #8363      +/-   ##
==========================================
- Coverage   49.49%   49.43%   -0.07%     
==========================================
  Files         153      153              
  Lines       17084    17166      +82     
==========================================
+ Hits         8456     8486      +30     
- Misses       7564     7610      +46     
- Partials     1064     1070       +6      | 
Signed-off-by: René Treffer <[email protected]>
Signed-off-by: René Treffer <[email protected]>
| /retest-required | 
    
      
        1 similar comment
      
    
  
    | /retest-required | 
| /test ci-fedora-critest | 
| The remaining test failures (rawhide rpm build) are in line with other PRs / builds and as far as I can tell unrelated. | 
| 
 @rtreffer, that is fine to ignore for now. We know why this is failing. See: 
 So nothing to worry about for now 😄 | 
Signed-off-by: René Treffer <[email protected]>
| /retest-required | 
    
      
        1 similar comment
      
    
  
    | /retest-required | 
| /retest | 
| /retest | 
Signed-off-by: René Treffer <[email protected]>
5dcace4    to
    a048e15      
    Compare
  
    | /retest | 
Signed-off-by: René Treffer <[email protected]>
| /retest | 
    
      
        3 similar comments
      
    
  
    | /retest | 
| /retest | 
| /retest | 
| /restest | 
| /retest | 
    
      
        1 similar comment
      
    
  
    | /retest | 
| /approve | 
| /approve thanks @rtreffer | 
| /retest | 
| /override ci/prow/ci-fedora-integration | 
| @saschagrunert: Overrode contexts on behalf of saschagrunert: ci/prow/ci-fedora-integration In response to this: 
 Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. | 
| [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, kwilczynski, rtreffer, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
 Approvers can indicate their approval by writing  | 
What type of PR is this?
/kind feature
What this PR does / why we need it:
On log rotate or container exit the logs are closed and fsync is used to flush the data to disk.
This results in good crash recovery behavior but it may cause IO locks that can cause pods to wait on logging to stdout/stderr. #6743 describes the issue.
conmonsupports--no-sync-logto avoid this issue. This PR adds the same (pass through)no_sync_logoption to cri-o.Related:
Which issue(s) this PR fixes:
Fixes: #6743
Special notes for your reviewer:
This is my first PR to CRI-O. I have been able to test this locally (manually),
conmonstarts up with--no-sync-log.Does this PR introduce a user-facing change?