Class: RightAws::RightAwsBase

Inherits:
Object
  • Object
show all
Defined in:
lib/awsbase/right_awsbase.rb

Constant Summary collapse

AMAZON_PROBLEMS =

Text, if found in an error message returned by AWS, indicates that this may be a transient error. Transient errors are automatically retried with exponential back-off.

[ 'internal service error', 
  'is currently unavailable',
  'no response from',
  'Please try again',
  'InternalError',
  'Internal Server Error',
  'ServiceUnavailable', #from SQS docs
  'Unavailable',
  'This application is not currently available',
  'InsufficientInstanceCapacity'
]
RAISE_ON_TIMEOUT_ON_ACTIONS =

Raise an exception if a timeout occures while an API call is in progress. This helps to avoid a duplicate resources creation when Amazon hangs for some time and RightHttpConnection is forced to use retries to get a response from it.

If an API call action is in the list then no attempts to retry are performed.

%w{ 
  AllocateAddress
  CreateSnapshot
  CreateVolume
  PurchaseReservedInstancesOffering
  RequestSpotInstances
  RunInstances
}
@@amazon_problems =
AMAZON_PROBLEMS
@@raise_on_timeout_on_actions =
RAISE_ON_TIMEOUT_ON_ACTIONS.dup

Class Method Summary collapse

Class Method Details

.amazon_problemsObject

Returns a list of Amazon service responses which are known to be transient problems. We have to re-request if we get any of them, because the problem will probably disappear. By default this method returns the same value as the AMAZON_PROBLEMS const.



196
197
198
# File 'lib/awsbase/right_awsbase.rb', line 196

def self.amazon_problems
  @@amazon_problems
end

.amazon_problems=(problems_list) ⇒ Object

Sets the list of Amazon side problems. Use in conjunction with the getter to append problems.



202
203
204
# File 'lib/awsbase/right_awsbase.rb', line 202

def self.amazon_problems=(problems_list)
  @@amazon_problems = problems_list
end

.raise_on_timeout_on_actionsObject



222
223
224
# File 'lib/awsbase/right_awsbase.rb', line 222

def self.raise_on_timeout_on_actions
  @@raise_on_timeout_on_actions
end

.raise_on_timeout_on_actions=(actions_list) ⇒ Object



226
227
228
# File 'lib/awsbase/right_awsbase.rb', line 226

def self.raise_on_timeout_on_actions=(actions_list)
  @@raise_on_timeout_on_actions = actions_list
end