Yes, --sandbox is very handy, but I cringe every time I see someone use it on a production system.
Sandbox mode doesn't just rollback, it creates an enclosing transaction for all of the commands you do while in that instance of the console. If you change database rows in that transaction, updates to the tables and rows affected can block for other users. This can cause lockups for other users if used in production.
Any rails console actions on production should be done carefully, and should (IMHO) never use --sandbox. Sandbox mode is really useful for development and other non-critical systems.
I wish I read your comments earlier today. I was testing out something in sandbox in product apparently triggered something recursive locked all records and Database cpu usage was 100%. Our application was down for 30-45 minutes. It recovered till someone restart the database instance 😭
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.