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

Mark legacy EDModule constructors deprecated #37592

Merged
merged 2 commits into from Apr 29, 2022

Conversation

makortel
Copy link
Contributor

@makortel makortel commented Apr 16, 2022

PR description:

We've noticed on a few occasions that marking the legacy EDModule base classes as CMS_DEPRECATED does not cover all the classes that inherit from these base classes. Marking functions deprecated seems to be more reliable to generate warnings, so this PR marks the constructors of the legacy EDModule base classes as CMS_DEPRECATED.

PR validation:

A legacy EDAnalyzer https://github.com/cms-sw/cmssw/blob/12_4_0_pre2/OnlineDB/SiStripO2O/plugins/SiStripPayloadMapTableCreator.cc that doesn't generate a warning in 12_4_0_pre2, generates a warning with this PR.

Attributing the (base) class deprecated does not lead to as wide
coverage of the deprecation warnings as we hoped, but attributing
functions seems to work. Let's try marking the constructors as
deprecated (on a small test it seems to work).
@cmsbuild cmsbuild added this to the CMSSW_12_4_X milestone Apr 16, 2022
@makortel makortel changed the title Mark the legacy EDModule constructors deprecated Mark legacy EDModule constructors deprecated Apr 16, 2022
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37592/29352

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

  • FWCore/Framework (core)

@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks.
@wddgit this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cfc78f/23964/summary.html
COMMIT: 90a7a5d
CMSSW: CMSSW_12_4_X_2022-04-15-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/37592/23964/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3593159
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3593135
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 200 log files, 45 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor Author

I checked to build log, and

  • the warning from the class with deprecation annotation flagged 395 files
  • the warning from the constructor with deprecation annotation flagged 455 files
  • 303 files were the same, 92 were flagged by class annotation only, 152 were flagged by constructor annotation only

I checked a few of the files flagged by class annotation only, and in those the EDModule itself was already threading-aware, but the file #included the header of a legacy module. I'm thinking to drop the class annotation, and go over the 92 files to remove the unnecessary #include (assuming they all were caused by that).

@Dr15Jones
Copy link
Contributor

I'm thinking to drop the class annotation, and go over the 92 files to remove the unnecessary #include (assuming they all were caused by that).

OK. Although it really is the class that is deprecated (so what is there is actually better documentation) and we want to get rid of those headers so we do want to catch cases where the header is improperly included.

@makortel
Copy link
Contributor Author

I'm thinking to drop the class annotation, and go over the 92 files to remove the unnecessary #include (assuming they all were caused by that).

OK. Although it really is the class that is deprecated (so what is there is actually better documentation) and we want to get rid of those headers so we do want to catch cases where the header is improperly included.

I agree annotating the class is much more clear, but I was thinking if two different kinds of warnings for the same issue would be confusing. Or should we understand them as strictly speaking separate issues (#include of deprecated header vs. actually deriving from a deprecated class)?

@makortel
Copy link
Contributor Author

I've now gone through the 92 files flagged by the class annotation only (see PRs linking to this PR). There were 2 or 3 cases where the class annotation lead to a .cc file being flagged because of a genuine legacy EDModule. In all of those cases the constructor was defined in a header file, and the constructor annotation lead to flagging of the header file.

I'll next remove the class annotations and add explanatory comments.

While in principle annotating the entire class would be the proper
thing to do, with gcc the constructor annotation appears to work
better for identifying the deriving classes that need to be migrated
to thread-friendly base classes.
@makortel
Copy link
Contributor Author

@cmsbuild, please test

All differences are in workflow 9.0, let's try again to see if these are repeatable

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cfc78f/24315/summary.html
COMMIT: f401fce
CMSSW: CMSSW_12_4_X_2022-04-27-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/37592/24315/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3158 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3695434
  • DQMHistoTests: Total failures: 9298
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3686114
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 205 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 1 / 48 workflows

@makortel
Copy link
Contributor Author

@cmsbuild, please test

9.0 again

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cfc78f/24322/summary.html
COMMIT: f401fce
CMSSW: CMSSW_12_4_X_2022-04-28-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/37592/24322/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3157 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3695434
  • DQMHistoTests: Total failures: 9298
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3686114
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 205 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 1 / 48 workflows

@makortel
Copy link
Contributor Author

9.0 shows still differences. Maybe this is another symptom of #34448? The changes in this PR are purely technical.

@makortel
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

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 (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants