-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Correct hostname retrieval from Source::getHostname #38309
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38309/30473
|
A new Pull Request was created by @4quarks (4Quarks) for master. It involves the following packages:
@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38309/30474
|
Pull request #38309 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3d8148/25879/summary.html Comparison SummarySummary:
|
hostname = id; | ||
if ((pos != std::string::npos) && (pos > 0)) { | ||
hostname = id.substr(0, pos); | ||
hostname.erase(remove(hostname.begin(), hostname.end(), ']'), hostname.end()); | ||
hostname.erase(remove(hostname.begin(), hostname.end(), '['), hostname.end()); |
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.
So your intent is to change something like [2001:760:4205:128::128:232]:1094
to be 2001:760:4205:128::128:232
?
Would it make sense to restrict the '[' to be at the beginning of the string and ']' to be at the end in order to remove it?
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.
It looks like the commit slipped in the PR. You can skip those changes. Thanks.
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.
@4quarks Could you drop the commit then? (that is pretty much the only way for us to "skip changes")
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38309/31064
|
Pull request #38309 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again. |
@cmsbuild, please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3d8148/26267/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
@4quarks Are you planning to take care of the backports? |
+1 |
PR description:
The piece of code [1] does the following: get the position of the first colon ":" and defines the hostname variable with anything that is before that colon. This supposition is based on the case that you have a hostname and a port i.e.
cms-xrd-global01.cern.ch:1094
--> hostname iscms-xrd-global01.cern.ch
. However, the information is not always available and therefore, when a raw IPv6 gets there, the output is incorrect as the information before the first colon is just the first octet of the IP i.e.[2001
from[2001:760:4205:128::128:232]:1094
.With the small change of using the cpp function
find_last_of
this problem is solved. Because it will try to find the last colon and get everything before it. This resolves both scenarioscms-xrd-global01.cern.ch:1094
and[2001:760:4205:128::128:232]:1094
.Thanks in advance.
[1]
PR validation:
You can run a manual HammerCloud test as explained on the Twiki https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSHammerCloud#Manual_execution
I've already done it and it works fine.
if this PR is a backport please specify the original PR and why you need to backport that PR:
This could be backported even to the CMSSW_9_2_6 version which is what is being used in production on HammerCloud.