bosh-director 1.3138.0 → 1.3139.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d53c72ce355df501653a7710e3219443385b4ab
4
- data.tar.gz: 4dabb374ff6da9561e50d6ebd9461935d5aba13b
3
+ metadata.gz: 98f1713d804a1392dd1e7e7a45c02967b76d1008
4
+ data.tar.gz: cb6ac654c1f04294c79c921bc26d807cd14999d0
5
5
  SHA512:
6
- metadata.gz: e7bd8ad5ebcebd2e56a4c5a544041e03e86adbf8594782fd8bf68f4f650cabd490f8f3bdc48cba9a4aeab9b2e465e30a3266ea8f3bf54585289beaa8e017bd06
7
- data.tar.gz: 3308c71035950b31ad17ac054de5045a3493435ea631da55944fb66aab4a278463fb9d741d61be1d3239589573670ced02a6ba0f8cd230059c593552ae2eeb1b
6
+ metadata.gz: e3bb9b6ca6855f45dbcd72376d299ccd318165320d555ef12859d047a16e31b3ec7c87daa113474c8f815bb262ebfcfb93a43152be4e99e194c989e38b9731f7
7
+ data.tar.gz: 2697c3c154f82fe3ace39feca99023e439bb3ef783342d91edb5377d4551a3e68149fcfc4819518d82584f92a3a092911b29bcbbbb52984f5926d8583c2a4ee0
@@ -19,6 +19,7 @@ module Bosh::Director
19
19
  @job_class = job_class
20
20
  @task_logger.info("Looking for task with task id #{@task_id}")
21
21
  @task = task_manager.find_task(@task_id)
22
+ @task_logger.info("Found task #{@task.inspect}")
22
23
  end
23
24
 
24
25
  # Runs director job
@@ -34,13 +35,6 @@ module Bosh::Director
34
35
  @task_logger.info("Task took #{duration} to process.")
35
36
  end
36
37
 
37
- # Task checkpoint: updates timestamp so running task isn't marked as
38
- # timed out.
39
- # @return [void]
40
- def checkpoint
41
- @task.update(:checkpoint_time => Time.now)
42
- end
43
-
44
38
  private
45
39
 
46
40
  # Sets up job logging.
@@ -98,7 +92,7 @@ module Bosh::Director
98
92
 
99
93
  run_checkpointing
100
94
 
101
- @task_logger.info("Performing task: #{@task.id}")
95
+ @task_logger.info("Performing task: #{@task.inspect}")
102
96
 
103
97
  @task.state = :processing
104
98
  @task.timestamp = Time.now
@@ -125,11 +119,15 @@ module Bosh::Director
125
119
  # same as Resque worker process lifetime.
126
120
  # @return [Thread] Checkpoint thread
127
121
  def run_checkpointing
122
+ # task check pointer is scoped to separate class to avoid
123
+ # the secondary thread and main thread modifying the same @task
124
+ # variable (and accidentally clobbering it in the process)
125
+ task_checkpointer = TaskCheckPointer.new(@task.id)
128
126
  Thread.new do
129
127
  with_thread_name("task:#{@task.id}-checkpoint") do
130
128
  while true
131
129
  sleep(Config.task_checkpoint_interval)
132
- checkpoint
130
+ task_checkpointer.checkpoint
133
131
  end
134
132
  end
135
133
  end
@@ -167,6 +165,16 @@ module Bosh::Director
167
165
  director_error = DirectorError.create_from_exception(exception)
168
166
  Config.event_log.log_error(director_error)
169
167
  end
168
+ end
169
+
170
+ class TaskCheckPointer
171
+ def initialize(task_id)
172
+ task_manager = Bosh::Director::Api::TaskManager.new
173
+ @task = task_manager.find_task(task_id)
174
+ end
170
175
 
176
+ def checkpoint
177
+ @task.update(:checkpoint_time => Time.now)
178
+ end
171
179
  end
172
180
  end
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Director
3
- VERSION = '1.3138.0'
3
+ VERSION = '1.3139.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-director
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3138.0
4
+ version: 1.3139.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3138.0
19
+ version: 1.3139.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3138.0
26
+ version: 1.3139.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bosh_cpi
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3138.0
33
+ version: 1.3139.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.3138.0
40
+ version: 1.3139.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bosh-registry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3138.0
47
+ version: 1.3139.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.3138.0
54
+ version: 1.3139.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: blobstore_client
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3138.0
61
+ version: 1.3139.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3138.0
68
+ version: 1.3139.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bosh-core
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.3138.0
75
+ version: 1.3139.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3138.0
82
+ version: 1.3139.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bosh-director-core
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.3138.0
89
+ version: 1.3139.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.3138.0
96
+ version: 1.3139.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bosh-template
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3138.0
103
+ version: 1.3139.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3138.0
110
+ version: 1.3139.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bosh_openstack_cpi
113
113
  requirement: !ruby/object:Gem::Requirement