glider 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 942daad303f059b635baba885e7cfc1a4f143403
4
- data.tar.gz: 2f80d4b0769547407f87ed909951074760dc0e5f
3
+ metadata.gz: 4c292fcb2cd2e9d5c19fadb681c6d251fe323f63
4
+ data.tar.gz: 11d350b7239ef1f60fa75d81212bf4faa32ec06f
5
5
  SHA512:
6
- metadata.gz: 079fbb53981ab9a4cf19eb990e16bf577dda9920440958832ba4e99e44bccf834fe8aa6c1b0512072cbbc057aa935d678679299d7d081510a941a813b09d3bae
7
- data.tar.gz: b73d5c0a1e4aa84555760be15bb4ebae20b097042e87b656a421cadb7934e3f63878dd526d3ef1a6c7f85caebbf00ddf245bf9dd3469c6da413860db1c22ba64
6
+ metadata.gz: d3b7d5739559fd0982c66ac41e01a4cbf023623768ba4ad6a40ef210bc5e6e52a6f1e2e26f44dd6ca7d3cbdc646db98374ec9c0683707431d1e0e0b4ece49a59
7
+ data.tar.gz: df0d2bd7ee79b7a62f1062c63d8e70500e3bce764e824cf638448338ce8924c9c9a01549f96523137cf77dddcee70120e68c0dc5e9e09bf2431f1fd381815f3c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -8,7 +8,7 @@ class MySWF < Glider::Component
8
8
  register_activity :hello_world, '1.5'
9
9
 
10
10
  def hello_world(input)
11
- task.fail! reason: "BECAUSE!" and return
11
+ task.fail! reason: "BECAUSE!" and task.fail! and return
12
12
  $logger.warn "Executing hello_world."
13
13
  sleep 2
14
14
  $logger.warn "Completed hello_world."
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glider 0.1.6 ruby lib
5
+ # stub: glider 0.1.7 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glider"
9
- s.version = "0.1.6"
9
+ s.version = "0.1.7"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["David Pelaez"]
@@ -52,30 +52,35 @@ module Glider
52
52
  $0 = "ruby #{activity_type.name}-#{activity_type.version}"
53
53
  signal_handling
54
54
  Glider.logger.info "Startig worker for #{activity_type.name} activity (pid #{Process.pid})"
55
- begin
56
- domain.activity_tasks.poll activity_type.name do |activity_task|
57
- task_lock! do
58
- begin
59
- workflow_id = activity_task.workflow_execution.workflow_id
60
- Glider.logger.info "Executing activity=#{activity_type.name} workflow_id=#{workflow_id}"
61
- target_instance = self.new activity_task
62
- input = process_input(activity_task.input)
63
- activity_result = target_instance.send activity_type.name, input
64
- begin
55
+ loop do
56
+ begin
57
+ domain.activity_tasks.poll activity_type.name do |activity_task|
58
+ task_lock! do
59
+ begin
60
+ workflow_id = activity_task.workflow_execution.workflow_id
61
+ Glider.logger.info "Executing activity=#{activity_type.name} workflow_id=#{workflow_id}"
62
+ target_instance = self.new activity_task
63
+ input = process_input(activity_task.input)
64
+ activity_result = target_instance.send activity_type.name, input
65
+
65
66
  activity_task.complete! result: activity_result.to_s unless activity_task.responded?
66
- rescue RuntimeError
67
- # this error sometimes appear if failing and completing happen very close in time and SWF doesn't report correctly the responded? status
68
- Glider.logger.warn "Ignoring error responding to activity task failed. Most likely caused because your task failed the activity already."
67
+
68
+ rescue AWS::SimpleWorkflow::ActivityTask::CancelRequestedError
69
+ # cleanup after ourselves
70
+ activity_task.cancel!
69
71
  end
70
- rescue AWS::SimpleWorkflow::ActivityTask::CancelRequestedError
71
- # cleanup after ourselves
72
- activity_task.cancel!
73
72
  end
74
73
  end
74
+ rescue AWS::SimpleWorkflow::Errors::UnknownResourceFault
75
+ $logger.error "An action relating to an expired workflow was sent. Probably the activity took longer than the execution timeout span."
76
+ rescue RuntimeError => e
77
+ if e.to_s == "already responded"
78
+ # this error sometimes appear if failing and completing happen very close in time and SWF doesn't report correctly the responded? status
79
+ Glider.logger.warn "Ignoring error responding to activity task failed. Most likely caused because your task failed the activity already."
80
+ else
81
+ raise e
82
+ end
75
83
  end
76
- rescue AWS::SimpleWorkflow::Errors::UnknownResourceFault
77
- $logger.error "An action relating to an expired workflow was sent. Probably the activity took longer than the execution timeout span. Killing activity process."
78
- exit 1
79
84
  end
80
85
  end
81
86
  end
@@ -138,15 +138,16 @@ module Glider
138
138
  $0 = "ruby #{workflow_type.name}-#{workflow_type.version}"
139
139
  signal_handling
140
140
  Glider.logger.info "Startig worker for #{workflow_type.name} (pid #{Process.pid})"
141
- begin
142
- domain.decision_tasks.poll workflow_type.name do |decision_task|
143
- task_lock! do
144
- process_decision_task workflow_type, decision_task
141
+ loop do
142
+ begin
143
+ domain.decision_tasks.poll workflow_type.name do |decision_task|
144
+ task_lock! do
145
+ process_decision_task workflow_type, decision_task
146
+ end
145
147
  end
148
+ rescue AWS::SimpleWorkflow::Errors::UnknownResourceFault
149
+ $logger.error "An action relating to an expired decision was sent. Probably the decider took longer than the decision timeout span."
146
150
  end
147
- rescue AWS::SimpleWorkflow::Errors::UnknownResourceFault
148
- $logger.error "An action relating to an expired decision was sent. Probably the decider took longer than the decision timeout span. Killing decider process."
149
- exit 1
150
151
  end
151
152
  end
152
153
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Pelaez