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

Mark Miller commented on SOLR-5477:
-----------------------------------

Hey Anshum, this looks pretty good!

I did a quick code review and dumped my comments below:

* Doesn't seem like this should be logged info level:
bq. log.info("REQUESTSTATUS action invoked: " + req.getParamString());

* We should pull requestid into a constant - there already is one in 
CoreAdminParams:
bq. r.add("requestid", (String) m.get(ASYNC));

* We should clean this up:
bq.        //    parallelHandlerThread.run();

* We should clean this up?
{noformat}
    } catch (Exception e) {
      throw e;
    }
{noformat}

* Shouldn't we at least keep doing this in non cloud mode?
bq. rsp.setHttpCaching(false);

* We should use constants here:
{noformat}
  /**
   * Handle "REQUESTSTATUS" action
   */
  protected void handleRequestActionStatus(SolrQueryRequest req, 
SolrQueryResponse rsp) {
    SolrParams params = req.getParams();
    String requestId = params.get(CoreAdminParams.REQUESTID);
    log.info("Checking request status for : " + requestId);

    if (mapContainsTask("running", requestId)) {
      rsp.add("STATUS", "running");
    } else if(mapContainsTask("completed", requestId)) {
      rsp.add("STATUS", "completed");
      rsp.add("Response", getMap("completed").get(requestId).getRspObject());
    } else if(mapContainsTask("failed", requestId)) {
      rsp.add("STATUS", "failed");
      rsp.add("Response", getMap("failed").get(requestId).getRspObject());
    } else {
      rsp.add("STATUS", "notfound");
      rsp.add("msg", "No task found in running, completed or failed tasks");
    }
  }
{noformat}

* The patch hits CoreAdminRequest but makes no real change.

* Should consider using ExecUtil.shutdown:
{noformat}
  public void shutdown() {
    if (parallelExecutor != null && !parallelExecutor.isShutdown())
      parallelExecutor.shutdown();
  }
{noformat}

* The following should continue CoreContainer shutdown even if it throws an 
exception:
bq.  coreAdminHandler.shutdown();

* Does this work nicely with the collections api solrj classes?

* In TestRequestStatusCollectionAPI, doesn't following mean the test can pass 
in bad cases and miss asserts?
{noformat}
    } catch (SolrServerException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
{noformat}

* Is there any stress testing? I wonder about some of the promises in terms of 
request id's and the status api for example - can two clients not race creating 
the same id? Are there any tests that try and fire off a bunch of these async 
commands in parralel?

> Async execution of OverseerCollectionProcessor tasks
> ----------------------------------------------------
>
>                 Key: SOLR-5477
>                 URL: https://issues.apache.org/jira/browse/SOLR-5477
>             Project: Solr
>          Issue Type: Sub-task
>          Components: SolrCloud
>            Reporter: Noble Paul
>            Assignee: Anshum Gupta
>         Attachments: SOLR-5477-CoreAdminStatus.patch, 
> SOLR-5477-updated.patch, SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, 
> SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, 
> SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, 
> SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, 
> SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, SOLR-5477.patch, 
> SOLR-5477.patch
>
>
> Typical collection admin commands are long running and it is very common to 
> have the requests get timed out.  It is more of a problem if the cluster is 
> very large.Add an option to run these commands asynchronously
> add an extra param async=true for all collection commands
> the task is written to ZK and the caller is returned a task id. 
> as separate collection admin command will be added to poll the status of the 
> task
> command=status&id=7657668909
> if id is not passed all running async tasks should be listed
> A separate queue is created to store in-process tasks . After the tasks are 
> completed the queue entry is removed. OverSeerColectionProcessor will perform 
> these tasks in multiple threads



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to