Hisoka-X commented on code in PR #4539:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4539#discussion_r1174990644


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:
##########
@@ -238,12 +238,17 @@ public TaskDeployState deployTask(@NonNull 
TaskGroupImmutableInformation taskImm
             Set<URL> jars = taskImmutableInfo.getJars();
             ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
             if (!CollectionUtils.isEmpty(jars)) {
-                classLoader = new 
SeaTunnelChildFirstClassLoader(Lists.newArrayList(jars));
-                taskGroup =
-                        
CustomClassLoadedObject.deserializeWithCustomClassLoader(
-                                nodeEngine.getSerializationService(),
-                                classLoader,
-                                taskImmutableInfo.getGroup());
+                try {
+                    classLoader = new 
SeaTunnelChildFirstClassLoader(Lists.newArrayList(jars));
+                    taskGroup =
+                            
CustomClassLoadedObject.deserializeWithCustomClassLoader(
+                                    nodeEngine.getSerializationService(),
+                                    classLoader,
+                                    taskImmutableInfo.getGroup());
+                } finally {
+                    ((SeaTunnelChildFirstClassLoader) classLoader).close();

Review Comment:
   Why close it in here? The ClassLoader will be used in any time when task not 
dead.



##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-2.4/src/main/java/org/apache/seatunnel/translation/spark/source/reader/micro/ParallelMicroBatchPartitionReader.java:
##########
@@ -123,7 +123,7 @@ public void virtualCheckpoint() {
             do {
                 checkpointRetries--;
                 if (internalRowCollector.collectTotalCount() == 0) {
-                    Thread.sleep(CHECKPOINT_SLEEP_INTERVAL);
+                    wait(CHECKPOINT_SLEEP_INTERVAL);

Review Comment:
   a few question: why change `sleep` to `wait`? If other thread invokes 
`notifyAll` mean this thread can't sleep with `CHECKPOINT_SLEEP_INTERVAL`. And 
`wait` will release lock, it unacceptable. 



-- 
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