Skip to content

Ignore "[Errno 29] Illegal seek" errors which may arise when using "upload_object_via_stream" method#1427

Merged
Kami merged 7 commits intoapache:trunkfrom
Kami:ignore_illegal_seek_on_hash
Feb 17, 2020
Merged

Ignore "[Errno 29] Illegal seek" errors which may arise when using "upload_object_via_stream" method#1427
Kami merged 7 commits intoapache:trunkfrom
Kami:ignore_illegal_seek_on_hash

Conversation

@Kami
Copy link
Copy Markdown
Member

@Kami Kami commented Feb 16, 2020

This pull request updates upload_object_via_stream method so any [Errno 29] Illegal seek error which is thrown by the underlying _hash_buffered_stream function is ignored.

Background

It looks like this regression has been inadvertently introduced in 4053779 (#1326 - cc @gvengel - just a heads up).

Some iterators such as PIPEs don't support seeking and in such case [Errno 29] Illegal seek exception is thrown.

In this context such exception is harmless so we should ignore it and proceed with hashing - this change does just that.

Thanks to @perbu for reporting this issue.

Closes #1424.


NOTE: If this change is ever cherry-picked into v2.8.x branch, it will need some additional changes to make it work under Python 2.x (OSEror -> IOError, etc.).

Kami added 2 commits February 16, 2020 22:42
That error likely represents a file handler / iterator which doesn't
support a seek operation (such as pipe) and in such scenario we simply
want to ignore that error.
@Kami Kami changed the title Ignore "[Errno 29] Illegal seek" errors which may arise when using "upload_object_via_stream" Ignore "[Errno 29] Illegal seek" errors which may arise when using "upload_object_via_stream" method Feb 16, 2020
@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 16, 2020

Codecov Report

Merging #1427 into trunk will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk    #1427      +/-   ##
==========================================
+ Coverage   86.09%   86.09%   +<.01%     
==========================================
  Files         370      370              
  Lines       77531    77538       +7     
  Branches     7656     7657       +1     
==========================================
+ Hits        66749    66756       +7     
  Misses       7883     7883              
  Partials     2899     2899
Impacted Files Coverage Δ
libcloud/dns/drivers/cloudflare.py 95.18% <ø> (ø) ⬆️
libcloud/test/dns/test_cloudflare.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00e431f...a7b24c4. Read the comment docs.

@Kami Kami merged commit d89f61f into apache:trunk Feb 17, 2020
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.

Documentation: Objectstore example is broken / libcloud does seek() on stream

2 participants