This problem seems to happen because (by bad luck) btrfsmaintenance starts running while doing a zypper dup, and the python script that defrags the rpm database hangs waiting for the lock on the database to be released and zypper in turn hangs waiting for btrfsmaintenance to exit (I think, no way for me to reproduce this but it is a problem that a lot of people are running into). (I apologize if I wasting people's time with my wild eyed guesses.)