Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on serialization/deserialization of total time #396

Closed
wandering-tales opened this issue Jun 14, 2023 · 0 comments · Fixed by #417
Closed

Error on serialization/deserialization of total time #396

wandering-tales opened this issue Jun 14, 2023 · 0 comments · Fixed by #417

Comments

@wandering-tales
Copy link

I have stumbled upon this weird error lately affecting the adjust_total_time method in the Iteration module:

def adjust_total_time
  self.total_time += (Time.now.utc.to_f - start_time.to_f).round(6)
end

Sometimes this addition fails with the following error:

TypeError: no implicit conversion of Float into String

We use Resque as queuing backend for ActiveJob and, browsing the Failures section of its web interface, I found out that the total_time job argument was sometimes saved as a string instead of a float (I'll omit other job arguments with potentially sensitive information):

# good

job_class: ********
job_id: 87dcc377-1b18-4f2c-ba58-f2645b6b83a7
provider_job_id:
queue_name: default
priority:
arguments:
- ...
  _aj_ruby2_keywords:
  - ...
executions: 1
exception_executions: {}
locale: en
timezone: UTC
enqueued_at: '2023-06-13T14:19:09Z'
cursor_position:
- 2
- f502bdad-2efd-4d71-89e0-d2077e59b59e
times_interrupted: 4
total_time: 3605.106918
# bad

job_class: ********
job_id: 15a254eb-218b-4c7d-8669-00c6e1342e75
provider_job_id:
queue_name: default
priority:
arguments:
- ...
  _aj_ruby2_keywords:
  - ...
executions: 1
exception_executions: {}
locale: en
timezone: UTC
enqueued_at: '2023-06-13T19:20:17Z'
cursor_position:
- 19
-
times_interrupted: 8
total_time: '7205.1291820000005'

My guess is a problem occurring either during the serialization or deserialization of job-iteration extra arguments, but I cannot figure out which.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant