Skip to content

Remove disk_partitions() maxfile and maxpath fields #2405

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

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

giampaolo
Copy link
Owner

Summary

  • OS: all
  • Bug fix: yes
  • Type: core, performance
  • Fixes: 2109

Description

Removes maxfile and maxpath fields from the namedtuple returned by disk_partitions(). Reason: if there's a NFS (network filesystem) this function can potentially take a long time to complete.

@giampaolo giampaolo changed the title 2109 rm slow disk partitions stats Remove disk_partitions() maxfile and maxpath fields Apr 17, 2024
@giampaolo giampaolo merged commit b6281c4 into master Apr 17, 2024
22 of 25 checks passed
@giampaolo giampaolo deleted the 2109-rm-slow-disk-partitions-stats branch April 17, 2024 15:52
ddelange added a commit to ddelange/psutil that referenced this pull request May 16, 2024
* 'master' of https://github.com/giampaolo/psutil:
  fix ruff errs
  skip flaky test on netbsd
  giampaolo#2408: fix some tests which were still failing due to the old name
  giampaolo#2408: ignore old "connections" name into as_dict()
  Rename `Process.connections()` to `Process.net_connections()` (giampaolo#2408)
  Remove disk_partitions() `maxfile` and `maxpath` fields (giampaolo#2405)
  Speedup process iter (don't check for PID reuse) (giampaolo#2404)
mcayanan pushed a commit to hysds/hysds that referenced this pull request Jun 20, 2024
Due to psutil 6.0.0 release, it is found that it broke the instance_stats service with the following error:

```
Traceback (most recent call last):
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 119, in <module>
    daemon(args.redis_url, args.redis_key, args.interval)
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 79, in daemon
    for device, mnt_point, fs_type, fs_opts, max_file, max_path, *other in psutil.disk_partitions():
ValueError: not enough values to unpack (expected at least 6, got 4)
```
According to the psutil pull request, giampaolo/psutil#2405, max_file and max_path were removed because if there's a NFS (network filesystem) this function can potentially take a long time to complete.
mcayanan added a commit to hysds/hysds that referenced this pull request Jun 20, 2024
* hot-fix: Update return from psutil.disk_partitions function

Due to psutil 6.0.0 release, it is found that it broke the instance_stats service with the following error:

```
Traceback (most recent call last):
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 119, in <module>
    daemon(args.redis_url, args.redis_key, args.interval)
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 79, in daemon
    for device, mnt_point, fs_type, fs_opts, max_file, max_path, *other in psutil.disk_partitions():
ValueError: not enough values to unpack (expected at least 6, got 4)
```
According to the psutil pull request, giampaolo/psutil#2405, max_file and max_path were removed because if there's a NFS (network filesystem) this function can potentially take a long time to complete.

* bump version

---------

Co-authored-by: Mike Cayanan <[email protected]>
mcayanan added a commit to hysds/hysds that referenced this pull request Mar 10, 2025
* hot-fix: Update return from psutil.disk_partitions function

Due to psutil 6.0.0 release, it is found that it broke the instance_stats service with the following error:

```
Traceback (most recent call last):
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 119, in <module>
    daemon(args.redis_url, args.redis_key, args.interval)
  File "/export/home/hysdsops/mozart/ops/hysds/scripts/log_instance_stats.py", line 79, in daemon
    for device, mnt_point, fs_type, fs_opts, max_file, max_path, *other in psutil.disk_partitions():
ValueError: not enough values to unpack (expected at least 6, got 4)
```
According to the psutil pull request, giampaolo/psutil#2405, max_file and max_path were removed because if there's a NFS (network filesystem) this function can potentially take a long time to complete.

* bump version

---------

Co-authored-by: Mike Cayanan <[email protected]>
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

1 participant