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

xrdfile: fixed reading part of file bigger than 2GB when file cursor set over 2GB. #86

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

pazembrz
Copy link

Additionally dockerfile update for tests not to fail as last working xrootd is 4.7.1.

closes: #85

@pazembrz pazembrz added this to In progress in Files bundle sprint (July 22 to Aug 2) via automation Jul 30, 2019
@pazembrz pazembrz moved this from In progress to Pending review in Files bundle sprint (July 22 to Aug 2) Jul 30, 2019


def test_reading_begining_of_big_file(tmppath):
"""Tests reading end of big file."""
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: code repetitions in the tests, could be reusable

@@ -22,6 +23,8 @@
from .utils import is_valid_path, is_valid_url, spliturl, \
translate_file_mode_to_flags

LOGGER = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep logger as lowercase, for consistency with the rest of the code

chunksize = sizehint if sizehint > 0 else self.size - self._ipp

if chunksize >= 2147483648: # 2GB in bytes
LOGGER.warning(
Copy link
Member

Choose a reason for hiding this comment

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

Is the logging necessary here? I mean the library is going to throw an OverFlowError if you pass beyond the limit. Also, as far as I remember, I did some tests, and it's not exactly 2GB the limit for some reason.

Either we just say that chunksizes >X get set to X so that the read will succeed....alternativelty, we throw an error

…set over 2GB.

Docker update for tests not to fail as last working xrootd is 4.7.1.

closes: inveniosoftware#85
@pazembrz pazembrz moved this from In progress to Pending review in Files bundle sprint (July 22 to Aug 2) Aug 1, 2019
@pazembrz pazembrz removed their assignment Aug 1, 2019
@lnielsen lnielsen merged commit ea25906 into inveniosoftware:master Aug 1, 2019
Files bundle sprint (July 22 to Aug 2) automation moved this from Pending review to Done Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Reading remaining data from end of very large files throws OverflowError
3 participants