wu-sheng commented on a change in pull request #4220: [WIP] sniffer processing 
profile task and report status and snapshot
URL: https://github.com/apache/skywalking/pull/4220#discussion_r366324319
 
 

 ##########
 File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/profile/ProfileTaskExecutionService.java
 ##########
 @@ -108,36 +139,49 @@ public void run() {
     /**
      * stop profile task, remove context data
      */
-    private synchronized void 
stopCurrentProfileTask(ProfileTaskExecutionContext needToStop) {
+    synchronized void stopCurrentProfileTask(ProfileTaskExecutionContext 
needToStop) {
         // stop same context only
         if (needToStop == null || 
!taskExecutionContext.compareAndSet(needToStop, null)) {
             return;
         }
 
+        // current execution stop running
+        needToStop.setRunning(false);
+
         // remove task
         profileTaskList.remove(needToStop.getTask());
 
-        // TODO notify OAP current profile task execute finish
+        // notify profiling task has finished
+        
ServiceManager.INSTANCE.findService(ProfileTaskChannelService.class).notifyProfileTaskFinish(needToStop.getTask());
     }
 
     @Override
     public void prepare() throws Throwable {
-
     }
 
     @Override
     public void boot() throws Throwable {
-
+        // init PROFILE_THREAD and start
+        profileThread = new ProfileThread();
+        profileThread.setDaemon(true);
+        profileThread.setName("PROFILE-MONITOR-THREAD");
 
 Review comment:
   `PROFILE-MONITOR-THREAD` -> `PROFILING-THREAD` . We don't use the word 
`monitor`, because SkyWalking is monitoring many places :)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to