What are the specific conditions that cause repeater lockup in multiplayer?

Solution 1:

I've had this happen to me once - my clock crossed a chunk boundary. When I left too far away from the clock, this causes one of the chunks to unload before the other. When only half the clock is in loaded chunks, the clock freezes.

To resolve this, you can put the clock in a single chunk:

  1. Walk to your repeater clock and press F3.
  2. In the upper left you'll see your coordinates, with a number in parenthesis next to X and Z. The numbers in parenthesis are the chunk coordinates.
  3. Walk the perimeter of your clock. If the numbers in parenthesis change, you've crossed a chunk border. Move the clock over several blocks so the entire circuit is in a single chunk.

Solution 2:

The actual reason this is happening is indeed chunk unloading.

The server "loads" chunks in a defined radius from each player. (see server.properties)
As long as players are around, the server keeps the chunk loaded and spawns mobs, updates redstone, grows grass, ...

However, if no player is near enough your clock to keep the chunk loaded, it will "unload" after some time to free some RAM and thus will stop updating redstone.

Note: When a repeater changes from off to on, the game actually changes the type of block (from 93 to 94)

As soon as a player comes near to the clock and loads the chunk, the server will just see the block 94 and won't update it. This is probably a bug, however there are some methods that will keep running after a chunk has re-loaded.

I'm not sure about singleplayer. The singleplayer is actually just a locally hosted server, but it does act a bit different, it should be simple to figure out though.

Keep in mind that (in the default server) the chunk-radius around spawn will never unload as long as a player is in the world.