ChaoquanTao opened a new issue, #17025:
URL: https://github.com/apache/dolphinscheduler/issues/17025

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Description
   
   ### 1. Unreasonable limit param in queryLog request
   QueryLog request will be triggered when user clicks the View log button in 
task instance detail modal. The limit param is carried in the request  to avoid 
response of queryLog too large, shown as:
   ```
   queryLog({
             taskInstanceId: nodeVariables.logTaskId,
             limit: nodeVariables.limit,
             skipLineNum: nodeVariables.skipLineNum
           }).then((res: any) => {
             nodeVariables.logRef += res.message || ''
             if (res && res.message !== '') {
               nodeVariables.limit += 1000
               nodeVariables.skipLineNum += res.lineNum
               getLogs(logTimer)
             } else {
               nodeVariables.logLoadingRef = false
               if (logTimer !== 0) {
                 if (typeof getLogsID === 'number') {
                   clearTimeout(getLogsID)
                 }
                 getLogsID = setTimeout(() => {
                   nodeVariables.limit += 1000
                   nodeVariables.skipLineNum += 1000
                   getLogs(logTimer)
                 }, logTimer * 1000)
               }
             }
           })
   ```
   The value of limit increases each time when queryLog fetches next page of 
log, which may cause param grows too fast and too much.  A constant limit 
should be more reasonable.
   
   2. Infinite recursive queryLog causes frontend and backend oom
   When queryLog method gets to the end of the log file, the else branch will 
be executed. If `logTimer !==0`, a recursibe call will be invoked, and this 
won't be stopped, finally leads to the frontend resource exhausted. Together 
with above unreasonable limit param, it could cause a performance issue in 
backend (worker exactly), even oom if the log size is too large.  
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to