Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • Not to mention the case of these operating systems that install new patches at every reboot, the network address that might change on some interfaces, defragmentation that could have altered places of data on the disk, etc... :-) Commented Jun 10, 2021 at 21:59
  • 1
    @Christophe Yes those are all potential changes. But some of them might be ignorable such as disk fragmentation. It's also likely that if you restart the machine twice in a short period of time, the state of patching after each reboot is the same. So if your goal is to ensure patches are applied, rebooting twice e.g. in the same hour would be idempotent for that purpose. Commented Jun 10, 2021 at 22:11
  • 1
    I have just emailed Tim Bray and he confirms that the reason why he considers that rebooting a machine is not idempotent is because he includes the modification of the machine state as part of the intended effect, not as part of the side effect. So multiple machine reboots will not have the same intended effect as a single one. Commented Jun 24, 2021 at 23:20
  • 1
    @Maggyero Interesting. That's not how I tend to think about servers that run my stateless applications though. Servers are restarted because patches were applied or because there wasn't enough load to need it until later, or because it's scheduled to restart every night. The state of the server is completely irrelevant to the application (as long as it's working, of course.) I have a hard time even considering that a side effect. It's like repaving a road. It's just maintenance. I don't even really care if it's the same host at any given moment. Commented Jun 25, 2021 at 13:43
  • 1
    @Maggyero I don't know if you want to reply back but I'm a little confused now that I think about it. Imdempotency doesn't mean no state changes, it just means the same update results in the same state. Let's say you were working in a datacenter and your boss told you to restart a server and later on, they ask if you did it but you can't remember. Can you restart it again without concern? The answer to that is what determines idempotency. Commented Jun 25, 2021 at 14:35