makara icon indicating copy to clipboard operation
makara copied to clipboard

Makara Harshly Handling a Validation Error

Open tmedford opened this issue 5 years ago • 6 comments

Why does Makara harshly handle a validation error. A connection should not be blacklisting based on validation.

image

image

image

tmedford avatar Feb 25 '19 15:02 tmedford

+1

wxwang33 avatar Feb 25 '19 15:02 wxwang33

Any update on this.

tmedford avatar Mar 04 '19 20:03 tmedford

@tmedford I'm sorry, I'm not sure I follow. Harshly handled errors don't cause a blacklisted connection, gracefully handled errors do: https://github.com/taskrabbit/makara/blob/7f6e9d0c1a8be6ff73b630f2092894a6556ff046/lib/makara/error_handler.rb#L26-L36

rosa avatar Mar 05 '19 19:03 rosa

@rosa Then why do we see a error log message in logs?

tmedford avatar Mar 16 '19 18:03 tmedford

@tmedford because it's an error, and it's raised as such. What you see in your logs comes from here:

def harshly(e) 
   ::Makara::Logging::Logger.log("Harshly handling: #{e}\n#{e.backtrace.join("\n\t")}") 
   raise e 
end

But no connection is blacklisted as result of it.

rosa avatar Mar 16 '19 18:03 rosa

@rosa - How to handle blacking issue 'Makara::Errors::AllConnectionsBlacklisted: [Makara/slave] All connections are blacklisted -> No error details'

  makara:
      id: postgresql
      sticky: true
      blacklist_duration: 5
      master_ttl: 5
      master_strategy: round_robin
      slave_strategy: failover # Keep the same until it is blacklisted
      # list your connections with the override values (they're merged into the top-level config)
      # be sure to provide the role if primary, role is assumed to be a replica if not provided
      connections:
        - role: master
          name: master
          host: <%= ENV['DB_HOST'] %>
          disable_blacklist: true
        #### implicit role: slave
        - name: replica1
          host: <%= ENV['DB_HOST_REPLICA_1'] %>
        - name: replica2
          host: <%= ENV['DB_HOST_REPLICA_2'] %>
        - name: replica3
          host: <%= ENV['DB_HOST_REPLICA_3'] %>

psahni avatar Jan 18 '24 09:01 psahni