Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67226

Deduplication of traces doesn't work for UserRPCRequest

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • 2.323

      https://github.com/jenkinsci/jenkins/blob/55c31c892c224b7bd12714ec1c20dbeae68defde/core/src/main/java/jenkins/telemetry/impl/SlaveToMasterFileCallableUsage.java#L72 is an attempt to deduplicate traces with object identities.

      Unfortunately, this doesn't work with traces from UserRPCRequest, that include a counter:

      Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](26) created at
      …
      
      Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](27) created at
      …
      
      Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](28) created at 
      …

      Another source for duplication is proxies:

      	at com.sun.proxy.$Proxy5.end(Unknown Source)
      
      	at com.sun.proxy.$Proxy6.end(Unknown Source) 

          [JENKINS-67226] Deduplication of traces doesn't work for UserRPCRequest

          Daniel Beck created issue -
          Daniel Beck made changes -
          Description Original: [https://github.com/jenkinsci/jenkins/blob/55c31c892c224b7bd12714ec1c20dbeae68defde/core/src/main/java/jenkins/telemetry/impl/SlaveToMasterFileCallableUsage.java#L72] is an attempt to deduplicate traces with object identities.

          Unfortunately, this doesn't work with traces from {{UserRPCRequest}}, that include a counter:
          {noformat}
          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](26) created at


          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](27) created at


          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](28) created at
          …{noformat}
          New: [https://github.com/jenkinsci/jenkins/blob/55c31c892c224b7bd12714ec1c20dbeae68defde/core/src/main/java/jenkins/telemetry/impl/SlaveToMasterFileCallableUsage.java#L72] is an attempt to deduplicate traces with object identities.

          Unfortunately, this doesn't work with traces from {{UserRPCRequest}}, that include a counter:
          {noformat}
          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](26) created at


          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](27) created at


          Command UserRequest:UserRPCRequest:hudson.maven.MavenBuildProxy2.end[](28) created at
          …{noformat}
          Another source for duplication is proxies:
          {noformat}
          at com.sun.proxy.$Proxy5.end(Unknown Source)

          at com.sun.proxy.$Proxy6.end(Unknown Source) {noformat}
          Jesse Glick made changes -
          Epic Link New: JENKINS-67173 [ 213575 ]

          Jesse Glick added a comment -

          And \r\n instead of \n, and line numbers in stack frames, and lambda names, and details of call sequences inside the JRE.

          Since the data collector evidently does no deduplication of its own, perhaps none of this matters anyway. I am currently using

          jq '.payload.traces[]' < traces.json | perl -pe 's/\\r\\n/\\n/g; s/(\\tat java[.][^\\]+\\n)+/\\tat java…\\n/g; s/\$Proxy[0-9]+/\$Proxy…/g; s/[(][0-9]+[)]/[…]/g; s/\$\$Lambda[^.]+/\$\$Lambda…/g; s/\.java:[0-9]+/.java:…/g' | sort | uniq | jq -r > traces.txt
          

          Jesse Glick added a comment - And \r\n instead of \n , and line numbers in stack frames, and lambda names, and details of call sequences inside the JRE. Since the data collector evidently does no deduplication of its own, perhaps none of this matters anyway. I am currently using jq '.payload.traces[]' < traces.json | perl -pe 's/\\r\\n/\\n/g; s/(\\tat java[.][^\\]+\\n)+/\\tat java…\\n/g; s/\ $Proxy [0-9]+/\ $Proxy …/g; s/[(][0-9]+[)]/[…]/g; s/\$\ $Lambda [^.]+/\$\ $Lambda …/g; s/\.java:[0-9]+/.java:…/g' | sort | uniq | jq -r > traces.txt
          Jesse Glick made changes -
          Remote Link New: This issue links to "jenkins #5957 (Web Link)" [ 27261 ]
          Jesse Glick made changes -
          Assignee New: Daniel Beck [ danielbeck ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Jesse Glick made changes -
          Released As New: 2.323
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]

          Daniel Beck added a comment -

          Behold! The beauty of hacking something together until it just barely works:

          jq --raw-output '.payload.traces[] | if test("MavenBuildProxy2") or test("LogParserStatusComputer") or test("GetJUnitTestResults") or test("cobertura[.]renderers[.]SourceCodePainter") or test("publish_over_ssh[.]BapSshKeyInfo[.]getEffectiveKey") or test("MavenSiteArchiver[.]postExecute") or test("violations[.]generate[.]ExecuteFilePath") or test("selenium[.]callables[.]SeleniumCallable") then empty else . end'

          Daniel Beck added a comment - Behold! The beauty of hacking something together until it just barely works: jq --raw-output '.payload.traces[] | if test("MavenBuildProxy2") or test("LogParserStatusComputer") or test("GetJUnitTestResults") or test("cobertura[.]renderers[.]SourceCodePainter") or test("publish_over_ssh[.]BapSshKeyInfo[.]getEffectiveKey") or test("MavenSiteArchiver[.]postExecute") or test("violations[.]generate[.]ExecuteFilePath") or test("selenium[.]callables[.]SeleniumCallable") then empty else . end'

            danielbeck Daniel Beck
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: