Skip to content

UX: warn about any (broken) leftover references to closed memory map objects - #16608

Merged
pllim merged 1 commit into
astropy:mainfrom
neutrinoceros:io.fits/ux/windows/warn_about_leftover_references
Jun 27, 2024
Merged

pllim merged 1 commit into
astropy:mainfrom
neutrinoceros:io.fits/ux/windows/warn_about_leftover_references

Conversation

@neutrinoceros

@neutrinoceros neutrinoceros commented Jun 25, 2024 •

Copy link
Copy Markdown
Contributor

Description

This is a follow up to #16581, suggested by @saimn in https://github.com/astropy/astropy/pull/16581/files#r1652506444

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@neutrinoceros
neutrinoceros force-pushed the io.fits/ux/windows/warn_about_leftover_references branch from 86bfdbc to 37e1cd7 Compare June 25, 2024 12:53
@pllim pllim added this to the v6.1.2 milestone Jun 25, 2024
Comment thread docs/changes/io.fits/16608.api.rst Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since #16581 is unreleased and looks like you reverted some of the changes from there, does the change log for #16581 need to be deleted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wrote this changelog entry as a complement to it, but I'd like @saimn's opinion on that before I change it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In pre-towncrier days, we would have modified the original entry by hand like this:

* blah blah [#16581, #16608]

But I am not sure how to do that with towncrier. So yes, let's wait for saimn. Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure, I think the only way is to edit the other entry... as long as it is not released and things are backported consistently, should be fine.

@neutrinoceros neutrinoceros Jun 26, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I merge both entries even though they were really done in two separate PRs ? How about I just edit the first one to reference this one (not using a hard link but a PR number) ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes I think just editing the previous one is the way to go, since both PRs will go in the same release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done. I don't think the bot will like it but hopefully you guys can still merge, right ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added a label for the bot to be happy but I'll let @saimn approve and merge. Thanks, all!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thank you !

@neutrinoceros
neutrinoceros marked this pull request as ready for review June 25, 2024 13:34
@neutrinoceros
neutrinoceros requested a review from saimn as a code owner June 25, 2024 13:34
Comment thread astropy/io/fits/hdu/hdulist.py Outdated
# counting `arr` and a reference as an argument to getrefcount(),
# see https://docs.python.org/3/library/sys.html#sys.getrefcount
warnings.warn(
f"Memory map object {arr} with id={id(arr)} was closed but "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

printing arr doesn't seem a good idea since this is the "old" arr and will result in a segfault I think...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤦🏻‍♂️ Of course. Thanks !

@astrofrog
astrofrog requested a review from saimn June 27, 2024 12:27
@neutrinoceros
neutrinoceros force-pushed the io.fits/ux/windows/warn_about_leftover_references branch from 81a4c53 to e8bfba0 Compare June 27, 2024 16:02
@pllim pllim added the skip-changelog-checks Tells bot to skip changlog checks label Jun 27, 2024

@saimn saimn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks!

@pllim
pllim enabled auto-merge June 27, 2024 16:15
@pllim
pllim merged commit 0d33f68 into astropy:main Jun 27, 2024
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Jun 27, 2024
pllim added a commit that referenced this pull request Jun 27, 2024
…608-on-v6.1.x

Backport PR #16608 on branch v6.1.x (UX: warn about any (broken) leftover references to closed memory map objects)
@neutrinoceros
neutrinoceros deleted the io.fits/ux/windows/warn_about_leftover_references branch March 18, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io.fits skip-changelog-checks Tells bot to skip changlog checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants