clp
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.
References
Internally, it was discovered that:
- When the job is cancelled by the user, the progress bar is still running.
- There are delays in UI updates after a search job is submitted.
- 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
- Update job status when the job is cancelled.
- Parallelize meteor method handlers.
- Change
SEARCH_SIGNALenums to strings instead of numbers.
Validation performed
-
cd <PROJECT_ROOT>; task -
cd ./build/clp-package/sbin; ./start-clp.sh -
./compress.sh ~/samples/hive-24hr/i-00c90a0f/ - Opened the WebUI address in a browser.
- Started a query with string
123and observed the job finished and the results are displayed in the results table. - Started another query with string
1234and 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.". - Checked the
results-metadatain MongoDB using MongoDB Compass and verified the job's last signal is a string ofresp-donethan an integer.
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.
- First trial:
- Second trial:
- Third trial:
| Trial | with this.unblock() |
w/othis.unblock() |
Speed up |
|---|---|---|---|
| 1 | 59 | 953 | |
| 2 | 47 | 490 | |
| 3 | 91 | 797 | |
| SUM | 197 | 2240 | 11.37056 |