[ 
https://issues.apache.org/jira/browse/YARN-10637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17313196#comment-17313196
 ] 

Qi Zhu commented on YARN-10637:
-------------------------------

Thanks [~pbacsko] for review.

Actually fs always enabled this, so we don't need to add this for FS-side:
{code:java}
@Override
public void serviceInit(Configuration conf) throws Exception {
  this.allocFile = getAllocationFile(conf);
  if (this.allocFile != null) {
    this.fs = allocFile.getFileSystem(conf);
    reloadThread = new Thread(() -> {
      while (running) {
        try {
          synchronized (this) {
            reloadListener.onCheck();
          }
          long time = clock.getTime();
          long lastModified =
              fs.getFileStatus(allocFile).getModificationTime();
          if (lastModified > lastSuccessfulReload &&
              time > lastModified + ALLOC_RELOAD_WAIT_MS) {
            try {
              reloadAllocations();
            } catch (Exception ex) {
              if (!lastReloadAttemptFailed) {
                LOG.error("Failed to reload fair scheduler config file - " +
                    "will use existing allocations.", ex);
              }
              lastReloadAttemptFailed = true;
            }
          } else if (lastModified == 0l) {
            if (!lastReloadAttemptFailed) {
              LOG.warn("Failed to reload fair scheduler config file because" +
                  " last modified returned 0. File exists: "
                  + fs.exists(allocFile));
            }
            lastReloadAttemptFailed = true;
          }
        } catch (IOException e) {
          LOG.error("Exception while loading allocation file: " + e);
        }
        try {
          Thread.sleep(reloadIntervalMs);
        } catch (InterruptedException ex) {
          LOG.info(
              "Interrupted while waiting to reload alloc configuration");
        }
      }
    });
    reloadThread.setName("AllocationFileReloader");
    reloadThread.setDaemon(true);
  }
  super.serviceInit(conf);
}
{code}

> We should support fs to cs support for auto refresh queues when conf changed, 
> after YARN-10623 finished.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-10637
>                 URL: https://issues.apache.org/jira/browse/YARN-10637
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Qi Zhu
>            Assignee: Qi Zhu
>            Priority: Major
>         Attachments: YARN-10637.001.patch, YARN-10637.002.patch, 
> YARN-10637.003.patch, YARN-10637.004.patch
>
>
> cc [~pbacsko] [~gandras] [~bteke]
> We should also fill this, when  YARN-10623 finished.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to