Azure / Azure/azure-storage-ruby
nilClass Exception with RetryPolicyFilter
- Dominant language
- Ruby
- Stars
- 88
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Description
If I use a simple RetryPolicyFilter as follows, when a retry is actually necessary, I get a nilClass exception because retry_data[:count] is nil. Am I using RetryPolicyFilter improperly? It seems like perhaps retry_data[:count] needs to be set to 0 in init_retry_data( )
```
blob_service = Azure::Storage::Blob::BlobService.new( storage_account_name: account_name, storage_sas_token: sas_token, storage_blob_host: blob_host )
blob_service.with_filter( Azure::Storage::Common::Core::Filter::RetryPolicyFilter.new( 5, 1 ))
```
```
/home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/storage/common/core/filter/retry_filter.rb:58:in `should_retry?': undefined method `<=' for nil:NilClass (NoMethodError)
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/http/retry_policy.rb:51:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/http/http_request.rb:110:in `block in with_filter'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/http/signer_filter.rb:28:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/http/signer_filter.rb:28:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/http/http_request.rb:110:in `block in with_filter'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/service.rb:36:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/filtered_service.rb:34:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/core/signed_service.rb:41:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-common-2.0.1/lib/azure/storage/common/service/storage_service.rb:60:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-blob-2.0.0/lib/azure/storage/blob/blob_service.rb:179:in `call'
from /home/jbeyer/.rvm/gems/ruby-2.4.10/gems/azure-storage-blob-2.0.0/lib/azure/storage/blob/block.rb:149:in `put_blob_block'
from test_video_upload.rb:70:in `block (3 levels) in '
from test_video_upload.rb:13:in `each_chunk'
from test_video_upload.rb:60:in `block (2 levels) in '
from /home/jbeyer/.rvm/rubies/ruby-2.4.10/lib/ruby/2.4.0/open-uri.rb:37:in `open'
from /home/jbeyer/.rvm/rubies/ruby-2.4.10/lib/ruby/2.4.0/open-uri.rb:37:in `open'
from test_video_upload.rb:59:in `block in '
from test_video_upload.rb:47:in `each'
from test_video_upload.rb:47:in `'
```
Contributor guide
Assessment
This issue has not been assessed yet.