Skip to content

gh-93253: Add an explicit message for when there is not enough disk space to create new semaphores #93254

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

Closed
wants to merge 3 commits into from

Conversation

86Ilya
Copy link

@86Ilya 86Ilya commented May 26, 2022

When there is not enough disk space to create new semaphores, a confusing error occurs.
This fix adds a clearer message.

When there is not enough disk space to create new semaphores, a confusing error occurs.
This fix adds a clearer message.
@ghost
Copy link

ghost commented May 26, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@86Ilya 86Ilya changed the title Added clear message Added clear message #93254 May 26, 2022
@86Ilya 86Ilya changed the title Added clear message #93254 gh-#93254 Added clear message May 26, 2022
@86Ilya 86Ilya changed the title gh-#93254 Added clear message gh-93254: Added clear message May 26, 2022
@86Ilya 86Ilya changed the title gh-93254: Added clear message gh-93253: Added clear message May 26, 2022
@@ -59,6 +60,10 @@ def __init__(self, kind, value, maxvalue, *, ctx):
unlink_now)
except FileExistsError:
pass
except OSError as e:
if e.errno == errno.ENOSPC:
raise Exception("There is not enough space in the"
Copy link
Member

Choose a reason for hiding this comment

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

This should be a more specific error, perhaps ProcessError.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Adam here.

except OSError as e:
if e.errno == errno.ENOSPC:
raise Exception("There is not enough space in the"
" file system(tmpfs) to create a semaphore") from e
Copy link
Member

Choose a reason for hiding this comment

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

What does "tmpfs" refer to here? Is it posix specific?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Adam here, since this path runs on Windows as well, mentioning tmpfs is misleading.

@AA-Turner AA-Turner added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels May 26, 2022
@AA-Turner
Copy link
Member

Ideally you should also add a test for the new error message, although I'm not sure how you'd set up the necessary conditions off the top of my head.

A

@merwok merwok linked an issue May 26, 2022 that may be closed by this pull request
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@ambv ambv changed the title gh-93253: Added clear message gh-93253: Add an explicit message for when there is not enough disk space to create new semaphores Jun 7, 2022
@@ -59,6 +60,10 @@ def __init__(self, kind, value, maxvalue, *, ctx):
unlink_now)
except FileExistsError:
pass
except OSError as e:
if e.errno == errno.ENOSPC:
raise Exception("There is not enough space in the"
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Adam here.

except OSError as e:
if e.errno == errno.ENOSPC:
raise Exception("There is not enough space in the"
" file system(tmpfs) to create a semaphore") from e
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Adam here, since this path runs on Windows as well, mentioning tmpfs is misleading.

@bedevere-bot
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uninformative error message when working with semaphores
6 participants