Skip to content

Conversation

olegrok
Copy link
Contributor

@olegrok olegrok commented Oct 8, 2025

Once I catched an error during tests:

tarantool/override/metrics/psutils/psutils_linux.lua:49: bad argument #1 to 'string.split' (string expected, got nil)

That shows that in some rare cases fio.read can return nil, err but before this patch this case was unhandled. This patch fixes it.

Also it was pretty strange to print a message via "print" function. It was changed to "log" module that is more native for tarantool.

This patch doesn't contain tests because it's pretty hard to reproduce such error (file was opened but file:read() returned an errors for some reasons).

Closes #526

@olegrok olegrok force-pushed the 526-fio-read-error branch from adad3b3 to 65bcb18 Compare October 8, 2025 14:02
@olegrok olegrok marked this pull request as ready for review October 8, 2025 14:07
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

Please, add a changelog entry into the CHANGELOG.md.

Once I catched an error during tests:
```
tarantool/override/metrics/psutils/psutils_linux.lua:49: bad argument #1 to 'string.split' (string expected, got nil)
```

That shows that in some rare cases fio.read can return `nil, err` but
before this patch this case was unhandled. This patch fixes it.

Also it was pretty strange to print a message via "print" function. It was changed to "log" module
that is more native for tarantool.

This patch doesn't contain tests because it's pretty hard to reproduce such error (file was opened
but `file:read()` returned an errors for some reasons).

Closes #526
@olegrok olegrok force-pushed the 526-fio-read-error branch from 65bcb18 to 2221f53 Compare October 9, 2025 11:21
@olegrok olegrok requested a review from oleg-jukovec October 9, 2025 11:22
@olegrok
Copy link
Contributor Author

olegrok commented Oct 9, 2025

Please, add a changelog entry into the CHANGELOG.md.

Done

Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

Thank you for the patch!

@olegrok olegrok merged commit 2221f53 into master Oct 9, 2025
18 checks passed
@olegrok olegrok deleted the 526-fio-read-error branch October 9, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tarantool/override/metrics/psutils/psutils_linux.lua:49: bad argument #1 to 'string.split' (string expected, got nil)

3 participants