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.



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

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.



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

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

.raise_on_timeout_on_actionsObject



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

def self.raise_on_timeout_on_actions
  @@raise_on_timeout_on_actions
end

.raise_on_timeout_on_actions=(actions_list) ⇒ Object



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

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