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

Python 3.8 DeprecationWarning when running arcstat with interval #10132

Closed
Avatat opened this issue Mar 14, 2020 · 3 comments
Closed

Python 3.8 DeprecationWarning when running arcstat with interval #10132

Avatat opened this issue Mar 14, 2020 · 3 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@Avatat
Copy link
Contributor

Avatat commented Mar 14, 2020

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 20.04
Linux Kernel 5.4.0-14-generic
Architecture x86_64
ZFS Version 0.8.3-1ubuntu3
SPL Version 0.8.3-1ubuntu3
Python 3.8.2

Describe the problem you're observing

Python throws DeprecationWarning when I run arcstat with a custom interval.

Describe how to reproduce the problem

Just run arcstat 2 using Python version 3.8 or above.

Include any warning/errors/backtraces from the system logs

# arcstat 2
    time  read  miss  miss%  dmis  dm%  pmis  pm%  mmis  mm%  arcsz     c  
18:47:02     0     0      0     0    0     0    0     0    0   7.7G  7.7G  
./arcstat:487: DeprecationWarning: an integer is required (got type decimal.Decimal).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  time.sleep(sint)
@Avatat
Copy link
Contributor Author

Avatat commented Mar 14, 2020

I would like to prepare Pull Request with the fix.

@behlendorf
Copy link
Contributor

@Avatat that would be great, please do!

@behlendorf behlendorf added the Type: Defect Incorrect behavior (e.g. crash, hang) label Mar 17, 2020
@Avatat
Copy link
Contributor Author

Avatat commented Mar 17, 2020

@behlendorf, thanks :)

I prepared a fix and pull request: #10142
Is everything ok with it?

jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
Changed interval value type from decimal to integer,
because of deprecation warning in Python 3.8 and above.
Also changed kstat values type from decimal to integer,
because all the values are integers.

Fixed behavior of arcstat when run without args.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Bartosz Zieba <bartosz@zieba.pro>
Closes openzfs#10132 
Closes openzfs#10142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

2 participants