clp icon indicating copy to clipboard operation
clp copied to clipboard

webui: Update job status when the job is cancelled; parallelize meteor method handlers; Change `SEARCH_SIGNAL` enums to strings instead of numbers.

Open junhaoliao opened this issue 1 year ago • 1 comments

References

Internally, it was discovered that:

  1. When the job is cancelled by the user, the progress bar is still running.
  2. There are delays in UI updates after a search job is submitted.
  3. It is hard to debug a job's lastSignal, which is a aggregated state from the last request by user and the last response by server , because the field appears as an base-10 integer in the MongoDB. Decimal to hex conversion is usually needed before developers can infer the status code.

Description

  1. Update job status when the job is cancelled.
  2. Parallelize meteor method handlers.
  3. Change SEARCH_SIGNAL enums to strings instead of numbers.

Validation performed

  1. cd <PROJECT_ROOT>; task
  2. cd ./build/clp-package/sbin; ./start-clp.sh
  3. ./compress.sh ~/samples/hive-24hr/i-00c90a0f/
  4. Opened the WebUI address in a browser.
  5. Started a query with string 123 and observed the job finished and the results are displayed in the results table.
  6. Started another query with string 1234 and cancelled the job before the job finished. Observed the progress bar to disappear and an error message is displayed as "The search results are inconclusive because the user cancelled the job.". image
  7. Checked the results-metadata in MongoDB using MongoDB Compass and verified the job's last signal is a string of resp-done than an integer.

junhaoliao avatar Mar 26 '24 22:03 junhaoliao

As discussed offline, let's make sure we need this.unblock() since the code is easier to reason about if we don't use it.

To address the discussed concerns, I performed some tests in a CPU-stressed environment (stress -cpu 24). According to the WebSocket Send/Receive messages timestamps, it is confirmed that adding this.unblock() does accelerate the time to get a response from the method search.submitQuery.

  1. First trial: a28e71a5d827284b8584f40a9c4cfe7
  2. Second trial: dd37e7bafde3746431d0e7a8a9d0e37
  3. Third trial: c2e31a9b0024bbb092209bc99e23a0d
Trial with this.unblock() w/othis.unblock() Speed up
1 59 953
2 47 490
3 91 797
SUM 197 2240 11.37056

junhaoliao avatar Apr 05 '24 08:04 junhaoliao