Skip to content

Conversation

@bbbriana
Copy link

@bbbriana bbbriana commented Jan 28, 2026

https://github.com/shop/issues/issues/1596

If there are no records, we cannot take any action so discard the job:

The job cannot function without the record:                                                                                                                                                                      
                                                                                                                                                                                                                   
  The RecordNotFound is raised during GlobalID deserialization, before perform is even called. But even if it weren't, look at what execute does immediately:                                                      
                                                                                                                                                                                                                   
  def execute                                                                                                                                                                                                      
    @commands = Commands.for(@task)      # needs task                                                                                                                                                              
    unless @task.pending?                 # needs task                                                                                                                                                             
      Rails.logger.error("Task ##{@task.id}...")  # needs task                                                                                                                                                     
      return                                                                                                                                                                                                       
    end                                                                                                                                                                                                            
    run                                                                                                                                                                                                            
                                                                                                                                                                                                                   
  And run calls:                                                                                                                                                                                                   
  - @task.ping                                                                                                                                                                                                     
  - @task.run!                                                                                                                                                                                                     
  - @task.write(...)                                                                                                                                                                                               
  - @task.report_complete!                                                                                                                                                                                         
  - etc.                                                                                                                                                                                                           
                                                                                                                                                                                                                   
  Every single operation requires the task record. Without it:                                                                                                                                                     
  - No commands can be built                                                                                                                                                                                       
  - No status can be checked                                                                                                                                                                                       
  - No output can be written                                                                                                                                                                                       
  - No completion can be reported        

@bbbriana bbbriana requested a review from a team January 28, 2026 01:11
@bbbriana bbbriana closed this Jan 29, 2026
@bbbriana bbbriana deleted the 01-27-discard_jobs_where_the_record_cannot_be_found branch January 29, 2026 23:08
@bbbriana
Copy link
Author

Closed in favor of a PR with a smaller blast radius: https://github.com/Shopify/shipit/pull/3433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant