Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Synchronous Execution of Astro Startup Jobs and minor fixes #3746

Merged
merged 1 commit into from Jun 26, 2017

Conversation

amitjoy
Copy link
Contributor

@amitjoy amitjoy commented Jun 26, 2017

The scheduling operations schedules few jobs and executes 2 specific jobs immediately. These two jobs are executed in a different thread to prevent blocking the thread that spawns it.

In addition, during handler initialize, channel linking and unlinking, we reschedule the jobs. And every time, before we reschedule the jobs, we remove the jobs from the ESH Core scheduler that are associated with the current thing.

As the jobs that execute immediately are handled by different threads, it is sometime noticed that while rescheduling, removal of jobs did occur after the jobs got rescheduled. This created unexpected issues in ESH Core scheduler. In this PR, we have rendered the asynchronous operations of executing immediate jobs in different threads to synchronous execution so that we can make sure the removal always happens before rescheduling.

Another note is that previously we required equals and hashcode to be overriden by AbstractJob but currently it is not used anymore. These equals and hashcode affected normal executions of scheduled jobs as well. Hence, the methods have been removed.

@kaikreuzer
Copy link
Contributor

Could you add a short description to the PR about what it does and fixes exactly?

@amitjoy
Copy link
Contributor Author

amitjoy commented Jun 26, 2017

@kaikreuzer Sure

@sjsf
Copy link
Contributor

sjsf commented Jun 26, 2017

Thanks for this fix!

I can confirm that the equals/hashcode implementation indeed was messing up the internal calculations of the next execution time in the scheduler.

Doing the initial job scheduling synchronously also sounds like a pretty good idea to me.

@amitjoy could you please fix the commit message and additionally include a sign-off-by line?

@sjsf
Copy link
Contributor

sjsf commented Jun 26, 2017

PS: fixes #3728
(note to self: auto-close won't work...)

@amitjoy
Copy link
Contributor Author

amitjoy commented Jun 26, 2017

@SJKA 😢 How did I forget it? Fixing it.

@sjsf
Copy link
Contributor

sjsf commented Jun 26, 2017

All good, that's what we have all this auto-validation stuff for 😄

Signed-off-by: Amit Kumar Mondal <admin@amitinside.com>
Copy link
Contributor

@triller-telekom triller-telekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaikreuzer kaikreuzer merged commit 04a064c into eclipse-archived:master Jun 26, 2017
@amitjoy amitjoy deleted the fix_missing_events branch June 26, 2017 17:30
@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 30, 2017
@kaikreuzer kaikreuzer added the bug label Dec 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants