Getting out from the `monitor is hung` state for a container

While changing settings for one of mine containers, I managed to mess it up and it’s now in ERROR state.
Whatever I try to do (stop, delete, info), I always get this message:
Error: Get container stated: Monitor is hung

How do I exit that state (wiping the container is also fine)

Look for the container processes in ps fauxw, you should see a [lxc monitor] process for that specific container. That’s what’s somehow stuck. killing it should kill the container at which point you should be able to start it back up.

That’s all assuming you’re not hitting a kernel bug which would most likely surface by having that monitor process unkillable and require a reboot to fix.

Thanks, that fixed it.
I think I made the container enter the error state by setting the inexistent kernel limit key (limits.kernel.memlock1 :)) while experimenting with lxd. I killed the monitor process, unset the wrong limit key and am able to start the container again.