**Build scan:**
https://gradle-enterprise.elastic.co/s/swrn2vccdizu6/tests/:qa:smoke-test-http:javaRestTest/org.elasticsearch.http.ClusterStateRestCancellationIT/testClusterStateRestCancellation

**Reproduction line:**
`./gradlew ':qa:smoke-test-http:javaRestTest' --tests "org.elasticsearch.http.ClusterStateRestCancellationIT.testClusterStateRestCancellation" -Dtests.seed=2034D67B43AAFEF0 -Dtests.locale=ca -Dtests.timezone=Europe/Madrid -Druntime.java=17`

**Applicable branches:**
main

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.http.ClusterStateRestCancellationIT&tests.test=testClusterStateRestCancellation

**Failure excerpt:**
```
java.lang.IllegalStateException: unable to launch a new watch service

  at __randomizedtesting.SeedInfo.seed([2034D67B43AAFEF0:A2A0FB19FD8E07BE]:0)
  at org.elasticsearch.reservedstate.service.FileSettingsService.startWatcher(FileSettingsService.java:271)
  at org.elasticsearch.reservedstate.service.FileSettingsService.startIfMaster(FileSettingsService.java:142)
  at org.elasticsearch.reservedstate.service.FileSettingsService.doStart(FileSettingsService.java:116)
  at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:43)
  at org.elasticsearch.node.Node.start(Node.java:1372)
  at org.elasticsearch.test.InternalTestCluster$NodeAndClient.startNode(InternalTestCluster.java:982)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  at java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:820)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  at java.lang.Thread.run(Thread.java:833)

  Caused by: java.io.IOException: User limit of inotify watches reached

    at sun.nio.fs.LinuxWatchService$Poller.implRegister(LinuxWatchService.java:264)
    at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:266)
    at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:364)
    at java.lang.Thread.run(Thread.java:833)

```
server/src/main/java/org/elasticsearch/reservedstate/service/FileSettingsService.java
* state of the snapshot for the current cluster.
     * <p>
     * If the current cluster where we are restoring the snapshot into has any operator file based settings, we'll
     * reset the reserved state version to 0.
     * <p>
     * If there's no file based settings file in this cluster, we'll remove all state reservations for
     * file based settings from the cluster state.
     * @param clusterState the cluster state before snapshot restore
     * @param mdBuilder the current metadata builder for the new cluster state
     */
    public void handleSnapshotRestore(ClusterState clusterState, Metadata.Builder mdBuilder) {
        assert currentNodeMaster(clusterState);
        ReservedStateMetadata fileSettingsMetadata = clusterState.metadata().reservedStateMetadata().get(NAMESPACE);
        
        
        
        
        if (watching() && Files.exists(operatorSettingsFile())) {
            if (fileSettingsMetadata != null) {
                ReservedStateMetadata withResetVersion = new ReservedStateMetadata.Builder(fileSettingsMetadata).version(0L).build();
                mdBuilder.put(withResetVersion);
            }
        } else if (fileSettingsMetadata != null) {
            mdBuilder.removeReservedState(fileSettingsMetadata);
        }
    }
    /**
     * 'Touches' the settings file so the file watcher will re-processes it.
     * <p>
     * The file processing is asynchronous, the cluster state or the file must be already updated such that