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

Pass name of connection to logs #843

Merged
merged 7 commits into from
Sep 14, 2023
Merged

Conversation

matoval
Copy link
Collaborator

@matoval matoval commented Sep 11, 2023

Fixes issue #840 by passing the connection name for both timeout connection log in monitorConnectionAging method and connection cancelled log in flood method.

select {
case ci.WriteChan <- message:
case <-ci.Context.Done():
s.Logger.Debug("connInfo cancelled during flood write")
s.Logger.Debug("connInfo for connection %s cancelled during flood write", conn)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would s.NodeID() be helpful in this log also @fosterseth ?

Copy link
Member

Choose a reason for hiding this comment

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

probably not necessary in this case

@AaronH88
Copy link
Contributor

Overall the PR is looking good,
The commit message needs a bit of revision though please.

Please have a look at the guideline we are following here; https://cbea.ms/git-commit/
Specifically:

Capitalize the subject line
Use the imperative mood in the subject line

@matoval matoval changed the title pass name of connection to logs Pass name of connection to logs Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #843 (dcbb573) into devel (466cb25) will increase coverage by 0.01%.
The diff coverage is 16.66%.

@@            Coverage Diff             @@
##            devel     #843      +/-   ##
==========================================
+ Coverage   30.28%   30.29%   +0.01%     
==========================================
  Files          44       44              
  Lines        8530     8530              
==========================================
+ Hits         2583     2584       +1     
+ Misses       5708     5707       -1     
  Partials      239      239              
Files Changed Coverage Δ
pkg/netceptor/netceptor.go 53.96% <16.66%> (+0.21%) ⬆️

... and 2 files with indirect coverage changes

s.Logger.Warning("Timing out connection, idle for the past %s\n", s.maxConnectionIdleTime)
timedOut[i]()
for conn := range timedOut {
s.Logger.Warning("Timing out connection from %s to %s, idle for the past %s\n", s.nodeID, conn, s.maxConnectionIdleTime)
Copy link
Member

Choose a reason for hiding this comment

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

I think the from nodeA to nodeB implies connection direction. Meaning I interpret that as nodeA is dialing a tcp listener on nodeB. However, it could be that nodeB dialed nodeA.

I think we should drop s.nodeID and just say "timing out connection %s, idle for the past %s`

@sonarcloud
Copy link

sonarcloud bot commented Sep 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@AaronH88 AaronH88 left a comment

Choose a reason for hiding this comment

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

lgtm

@AaronH88 AaronH88 merged commit a3fd0ca into ansible:devel Sep 14, 2023
15 of 16 checks passed
AaronH88 pushed a commit to AaronH88/receptor that referenced this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants