Open sahanHe opened 1 year ago
The task module disabled all logs by resetting the logger manager. Hence, Could't logs other module logs when using task operation.
import ballerina/http;
import ballerina/io;
import ballerina/lang.runtime;
import ballerina/task;
type Album readonly & record {|
string title;
string artist;
|};
class Job {
*task:Job;
int i = 1;
public function execute() {
self.i += 1;
io:println("MyCounter: ", self.i);
}
isolated function init(int i) {
self.i = i;
}
}
service /info on new http:Listener(9095) {
resource function get albums(http:Request req) returns Album[]|error {
http:Client albumEP = check new ("localhost:9090");
task:JobId id = check task:scheduleJobRecurByFrequency(new Job(0), 1);
runtime:sleep(5);
Album[] albums = check albumEP->forward("/albums", req);
return albums;
}
}
Therefore, the task module was improved to enable logs excluding quartz logs. This fix has been tested. It works as expected. And, all the builds are passed without any errors except the release action build. But, the release builds produce some quartz logs intermittently.
@kalaiyarasiganeshalingam do we know why relaease build produce some quartz logs intermittently?
@ThisaruGuruge / @keizer619 FYA please
We couldn't figure out the actual reason as we couldn't reproduce it locally with the given fix.
When I remove all the fixes, I am able to reproduce the error locally.
May 02, 2023 4:41:06 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Using default implementation for ThreadExecutor
May 02, 2023 4:41:06 PM org.quartz.core.SchedulerSignalerImpl <init>
INFO: Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
May 02, 2023 4:41:06 PM org.quartz.core.QuartzScheduler <init>
INFO: Quartz Scheduler v.2.3.2 created.
May 02, 2023 4:41:06 PM org.quartz.simpl.RAMJobStore initialize
INFO: RAMJobStore initialized.
May 02, 2023 4:41:06 PM org.quartz.core.QuartzScheduler initialize
INFO: Scheduler meta-data: Quartz Scheduler (v2.3.2) 'QuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 5 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
May 02, 2023 4:41:06 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler 'QuartzScheduler' initialized from an externally provided properties instance.
May 02, 2023 4:41:06 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler version: 2.3.2
May 02, 2023 4:41:06 PM org.quartz.core.QuartzScheduler start
INFO: Scheduler QuartzScheduler_$_NON_CLUSTERED started.
MyCounter: 1
MyCounter: 2
MyCounter: 3
MyCounter: 4
MyCounter: 5
Description:
The publish release workflow fails for the 2201.4.2 release with a output verification error in task BBEs with the following log.
This can be viewed here
Steps to reproduce: Observed while running the publish release workflow for 2201.4.2
Affected Versions: Balerina distribution 2201.4.2