Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device job deploy v2 improvements #2524

Merged
merged 15 commits into from
Jun 21, 2019
Merged

Conversation

Coduz
Copy link
Contributor

@Coduz Coduz commented Mar 22, 2019

This PR introduces a bunch of improvements for the Job Engine to work properly with async package management service.

Related Issue
None

Description of the solution adopted
Now the NotificationMessage listener checks also for job to be restarted for a target that has completed the Package install

Screenshots
None

Any side note on the changes made
Javadoc and small code improvements applied.

@Coduz Coduz added the Enhancement This PR/Issue improves an part of Kapua label Mar 22, 2019
@Coduz Coduz requested a review from lorthirk March 22, 2019 13:34
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 7f5cefe to 52bfc37 Compare March 25, 2019 15:01
@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #2524 into develop will increase coverage by 5.69%.
The diff coverage is 13.79%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2524      +/-   ##
=============================================
+ Coverage      50.23%   55.93%   +5.69%     
+ Complexity      2453     1502     -951     
=============================================
  Files            958     1073     +115     
  Lines          27553    25955    -1598     
  Branches        2261     2332      +71     
=============================================
+ Hits           13842    14517     +675     
+ Misses         12732    10450    -2282     
- Partials         979      988       +9
Impacted Files Coverage Δ Complexity Δ
...ua/service/job/targets/internal/JobTargetImpl.java 55.17% <ø> (+48.27%) 10 <0> (+9) ⬆️
...kapua/service/job/targets/JobTargetAttributes.java 0% <ø> (ø) 0 <0> (?)
.../DeviceManagementNotificationMessageProcessor.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...pse/kapua/service/job/targets/JobTargetStatus.java 100% <100%> (ø) 1 <0> (?)
...ons/model/AbstractKapuaUpdatableEntityCreator.java 30% <14.28%> (-27.15%) 0 <0> (ø)
...atastore/internal/model/StorableIdFactoryImpl.java 0% <0%> (-100%) 0% <0%> (-2%)
...e/authentication/token/AccessTokenXmlRegistry.java 0% <0%> (-60%) 0% <0%> (ø)
...rnal/model/query/StorablePredicateFactoryImpl.java 28.57% <0%> (-42.86%) 0% <0%> (-5%)
...pse/kapua/service/authorization/domain/Domain.java 0% <0%> (-40%) 0% <0%> (ø)
.../kapua/commons/model/AbstractKapuaNamedEntity.java 76.47% <0%> (-23.53%) 0% <0%> (ø)
... and 426 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35b78c3...879ba8c. Read the comment docs.

@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 0f676a4 to 9bb3577 Compare April 2, 2019 09:55
@Coduz Coduz marked this pull request as ready for review April 2, 2019 10:30
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch 2 times, most recently from a68f2f3 to 3072e7a Compare April 5, 2019 13:40
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 3072e7a to 0fd1b50 Compare April 16, 2019 12:22
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch 3 times, most recently from 868337f to 456ee08 Compare May 14, 2019 11:50
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 456ee08 to cab89ee Compare May 21, 2019 07:38
@stefanomorson stefanomorson self-requested a review May 29, 2019 07:24
Copy link
Contributor

@stefanomorson stefanomorson left a comment

Choose a reason for hiding this comment

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

After reviewing the work in this PR a possible improvement emerged. It is described here below.

When a long running operation is executed, there is a limited possibility that some unsolicited messages sent by the device in order to notify the progress are delivered before the operation execution returns.
As a consequence, if the operation was invoked by a device job, the notification handler is not able to address the correct job in order to update its status and trigger execution of the next job steps.
This is currently solved in the job business logic by passing a unique id as a parameter for
the operation execution. While this works it exposes the client code to more complexity
that is related to implementation details.

Instead of passing the id in, the job should wait until the execution of the operation returns passing back the id of the operation registry to the job. Possible notifications received from the device while the operation execution was in progress, are already logged and persisted in the operation-registry-notification table so they can be used by the job to recover the "missed" notifications.
After the operation execution returns, the job should use the id of the operation registry to retrieve the notifications already collected from the operation-registry-notification table and use them to update the job: update the progress and trigger execution of the next job steps (e.g. enqueuing job executions).

@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from cab89ee to 3c6c0bd Compare June 4, 2019 10:28
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 3c6c0bd to 60ba14c Compare June 17, 2019 10:30
Coduz added 11 commits June 19, 2019 16:36
…installTargetProcessor

Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
…Package job step

Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
…e' module

Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Coduz added 3 commits June 19, 2019 16:37
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
Signed-off-by: coduz <alberto.codutti@eurotech.com>
@Coduz Coduz force-pushed the feature-deviceJobDeployV2Improvements branch from 60ba14c to 8180351 Compare June 19, 2019 14:41
Signed-off-by: coduz <alberto.codutti@eurotech.com>
@Coduz Coduz merged commit 33d63bb into develop Jun 21, 2019
@Coduz Coduz deleted the feature-deviceJobDeployV2Improvements branch June 21, 2019 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants