bpo-39584: raise ValueError when creating shared memory of size greater than 1TB by vinay0410 · Pull Request #21877 · python/cpython · GitHub
Skip to content

bpo-39584: raise ValueError when creating shared memory of size greater than 1TB#21877

Closed
vinay0410 wants to merge 1 commit into
python:mainfrom
vinay0410:fix-issue-39584
Closed

bpo-39584: raise ValueError when creating shared memory of size greater than 1TB#21877
vinay0410 wants to merge 1 commit into
python:mainfrom
vinay0410:fix-issue-39584

Conversation

@vinay0410

@vinay0410 vinay0410 commented Aug 14, 2020

Copy link
Copy Markdown
Contributor

@vinay0410 vinay0410 requested a review from tiran as a code owner August 14, 2020 09:11
@vinay0410 vinay0410 changed the title bpo-39584: raise ValueError when creating shared memory of greater than 1TB bpo-39584: raise ValueError when creating shared memory of size greater than 1TB Aug 15, 2020
@vinay0410

Copy link
Copy Markdown
Contributor Author

@vinay0410 vinay0410 closed this Aug 28, 2020
@vinay0410

Copy link
Copy Markdown
Contributor Author

reopened PR to re-trigger CI

@vinay0410 vinay0410 reopened this Aug 28, 2020

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.

I don't think this is a valid use of the code role.

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.

Can you have a look at this: #21556 (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.

Hmm. Okay. But double backquotes are usually used in cases like this (as specified by the developer's guide https://devguide.python.org/documenting/#inline-markup).

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 guess both of them work. See this https://devguide.python.org/documenting/#module-specific-markup .
I was going for this because it is tried and tested.
Although, if you still want me to change to double back ticks, I will make changes.

Comment thread Lib/multiprocessing/shared_memory.py Outdated
Comment thread Lib/test/_test_multiprocessing.py Outdated

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.

I don't think there's a need for this comment.

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 added this comment because similar tests around this test use such comments.

Comment thread Lib/test/_test_multiprocessing.py Outdated

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.

There's no need for a variable here.

@vinay0410 vinay0410 Sep 3, 2020

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.

Totally agree, I will remove that.
But, if you see there are similar tests around this test assigning an unnecessary variable, should I remove those too ? Or should raise another pull request removing those.

Comment thread Doc/library/multiprocessing.shared_memory.rst Outdated
@vinay0410 vinay0410 force-pushed the fix-issue-39584 branch 2 times, most recently from 6eaa6da to 691f27c Compare September 3, 2020 10:40

@ronaldoussoren ronaldoussoren 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.

This PR changes the limit for all systems, not just on macOS. I'd prefer to have the limit only on macOS, the behaviour of other unix-y systems (and in particular Linux) is different and likely don't need this artificial limit.

if not isinstance(item, (str, bytes))
else self._types_mapping[type(item)] % (
self._alignment * (len(item) // self._alignment + 1),
)

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.

Please don't mix actual changes with formatting changes.

try:
offset = self._offset_data_start + self._allocated_offsets[position]
offset = self._offset_data_start + \
self._allocated_offsets[position]

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.

Likewise

else:
allocated_length = self._allocated_offsets[position + 1] - item_offset
allocated_length = self._allocated_offsets[position +
1] - item_offset

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.

Likewise

@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@ronaldoussoren

Copy link
Copy Markdown
Contributor

Also: I don't feel qualified to approve changes to multiprocessing. This is a complex library that I don't use myself.

@tiran tiran left a comment

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.

Please read my most recent comment on bpo. 1 TB is arbitrary and far too low.

@iritkatriel

Copy link
Copy Markdown
Member

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.

8 participants