Feature #2029

Process tracking and notifications

Added by Davide Principi about 8 years ago. Updated over 7 years ago.

Status:CLOSEDStart date:06/18/2013
Priority:NormalDue date:11/14/2013
Assignee:-% Done:

100%

Category:nethserver-lib
Target version:v6.5-beta3
Resolution: NEEDINFO:No

Description

Implement a mechanism that carries a message from slow processes (such as yum transactions and NethServer events) to the web client.

The message can represent:
  1. the task progress %
  2. the process exit code
  3. informational messages

Related issues

Related to Nethgui - Feature #89: User notifications and flash messages CLOSED 05/04/2011
Related to NethServer 6 - Feature #1768: Centralized notification system CLOSED
Duplicated by NethServer 6 - Feature #1531: Base: package installation progress tracking and UI locking CLOSED 07/12/2013 07/15/2013

Associated revisions

Revision bba38d10
Added by Davide Principi about 8 years ago

Framework: Session unlock() immediately after response is sent. Refs #2029

Revision 56505821
Added by Davide Principi almost 8 years ago

esmith::event: removed unused code. Refs #2029

Revision 15901687
Added by Davide Principi almost 8 years ago

Export PTRACK_SOCKETPATH environment variable. Refs #2029

The ptrack wrapper opens a listening socket on the given path. To run
ptrack unprivileged, this variable must be passed to child processes
by sudo command.

Revision 74b0ffb6
Added by Davide Principi over 7 years ago

*.spec.in: Added nethserver-lib requirement. Refs #2029

Revision 0a17237e
Added by Davide Principi over 7 years ago

Track installation progress with nethserver.ptrack. Refs #2029

Revision f91750fd
Added by Davide Principi over 7 years ago

nethserver yum plugin renamed nethserver-events. Refs #2029

Avoids ptrack namespace conflicts during plugin loading.

Revision 18cea902
Added by Davide Principi over 7 years ago

Start detached process inside a ptrack wrapper. Refs #2029

Revision 23606255
Added by Davide Principi over 7 years ago

JS client: Try to repeat a failed request, if possible. Refs #2029

FIXME: this must be done only for GET requests!

The request can be repeated if the connection fails, or if the
response is temporary (404).

Revision b80f09e5
Added by Davide Principi over 7 years ago

Track progress with ptrack socket. Refs #2029

Changed PackageManager UI module button labels. Check task exit codes
to see if any event has failed.

Revision 71c3be8d
Added by Davide Principi over 7 years ago

Fixed CSS ButtonList class margin. Refs #2029

Revision d7044537
Added by Davide Principi over 7 years ago

ptrack command: the task progress tracking server. Refs #2029

Revision 5c9774ad
Added by Davide Principi over 7 years ago

Make esmith::templates::processTemplate() return a value. Refs #2029

Revision bee0733d
Added by Davide Principi over 7 years ago

runlevel-adjust: added NethServer::TrackerClient calls. Refs #2029

Revision d4f6c113
Added by Davide Principi over 7 years ago

Handle error conditions from HTTP status codes. Refs #2029

Automatic retry is attempted only for GET requests.

Revision b5e24fb9
Added by Davide Principi over 7 years ago

Action _onSendQuery(): execute if delay == 0 or undefined. Refs #2029

Revision 20b9adc7
Added by Davide Principi over 7 years ago

Renamed nethserver_events plugin. Refs #2029

Plugin file name must be conforming to PEP-8. This allows to import it
as any other module.

Revision b0a953ad
Added by Davide Principi over 7 years ago

Added run_events() function. Refs #2029

Refactored for system-adjust action.

Revision b89f346a
Added by Davide Principi over 7 years ago

Use nethserver_events Yum plugin module. Refs #2029

The Yum plugin was reworked.

Revision b36cc20c
Added by Davide Principi over 7 years ago

Reload PackageManager Packages. Refs #2029

When Yum transaction ends Packages view must be refreshed.

Revision 680d595d
Added by Davide Principi over 7 years ago

NethServer::Service (adjust): changed return value type to boolean. Refs #2029 #2014

The method now returns a TRUE/FALSE success condition, and sets again
the output parameter "action", passed by reference.

Revision 507aa85d
Added by Davide Principi over 7 years ago

Report errors in exit status code. Refs #2029 #2014

Revision 70726e86
Added by Davide Principi over 7 years ago

Utility to inspect ptrack dumps. Refs #2029

Revision 060d177f
Added by Davide Principi over 7 years ago

Split status code by Status and Signal field. Refs #2029

This changes the format of the syslog line, by adding a "Signal" or an
"ExitCode" field if status is non-zero.

The Status field is unchanged.

Revision 9b395a3e
Added by Davide Principi over 7 years ago

Fixed RPM transaction progress calculation. Refs #2029

Added an "Initialization" task that covers dependencies resolution.

Revision 8a0673ef
Added by Davide Principi over 7 years ago

generic_template_expand action: report exit status code. Refs #2029

Revision ab2ec6f0
Added by Davide Principi over 7 years ago

read_package_list(): consider any package containing an "-update" event. Refs #2029

The 'nethserver' prefix is no longer required in a package name: the
package list contains any package with an event named after
"<packagename>-update".

Revision 772fa618
Added by Davide Principi over 7 years ago

Signal nethserver-sogo-thunderbird-update manually! Refs #1871 #2029

Running signal-event in RPM %post script breaks the progress tracking

Revision d94eb9dd
Added by Davide Principi over 7 years ago

Fix esmith::templates::processTemplate() return value. Refs #2029

The return value was undefined with a missing output file.

Revision 7fbd556a
Added by Giacomo Sanchietti over 7 years ago

pkgaction: track packages download. Refs #2029

Revision f7201c1d
Added by Davide Principi over 7 years ago

Download task enhancements. Refs #2029

To balance tasks weight, the Download task is skipped for remove
actions. Also give a weight to each package download, based on
effective package size.

Revision c362c760
Added by Davide Principi over 7 years ago

Print formatted error messages from Yum. Refs #2029

Revision 8b6b85b0
Added by Davide Principi over 7 years ago

Handle pkgaction errors. Refs #2029

If the pkgaction process exit with non-zero status, print the error
message.

History

#1 Updated by Davide Principi about 8 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • Start date set to 06/18/2013
  • % Done changed from 20 to 30

#2 Updated by Davide Principi almost 8 years ago

  • Project changed from Nethgui to NethServer 6

#3 Updated by Giacomo Sanchietti almost 8 years ago

  • Target version changed from v6.4-beta2 to v6.5-beta3

#4 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60
Changed packages:
  • nethserver-lib
  • nethserver-yum
  • nethserver-base
  • nethserver-nethgui
  • nethserver-httpd-admin
Changes affect
  • The Perl esmith::event module
  • The following actions:
    • runlevel-adjust
    • adjust-services
    • generic_template_expand
  • The pkgaction command, a Yum cli wrapper that installs/removes packages
  • The PackageManager UI module
  • Possibly any other UI module starting "background" processes, through exec or signalEvent. In other words any UI module relying on Nethgui\System\ProcessDetached class.
Also

#5 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

Test case

No specific test case is provided. As indicated in note-4, PackageManager UI module and other affected parts must not alter their behaviour.

In nethserver-testing:
nethserver-lib-1.3.2-4.0gitbee0733d.ns6.noarch.rpm
nethserver-yum-1.1.1-3.0gitf91750fd.ns6.noarch.rpm
nethserver-base-1.4.3-2.0gitb80f09e5.ns6.noarch.rpm
nethserver-nethgui-1.2.4-7.0git23606255.ns6.noarch.rpm
nethserver-httpd-admin-1.0.6-5.0git71c3be8d.ns6.noarch.rpm

#6 Updated by Davide Principi over 7 years ago

In nethserver-testing:
nethserver-nethgui-1.2.4-8.0gitd4f6c113.ns6.noarch.rpm
nethserver-httpd-admin-1.0.6-7.0git8d9ea0db.ns6.noarch.rpm

#7 Updated by Davide Principi over 7 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

TODO
Check if system-adjust action is still working. It imports nethserver from /usr/lib/yum-plugins, but the plugin was renamed!

    $ rpm -qf /etc/e-smith/events/actions/system-adjust 
nethserver-base-1.4.3-1.ns6.noarch
    $ cat /etc/e-smith/events/actions/system-adjust
#!/bin/env /usr/bin/python

import sys
sys.path.append('/usr/lib/yum-plugins')

import nethserver

nethserver.reconfigure_all_packages()
nethserver.adjust_all_services()

[davidep@nethservice ~]$

#8 Updated by Davide Principi over 7 years ago

  • Due date set to 11/14/2013
  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30
  • Estimated time set to 96.00

#9 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

#10 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-yum-1.1.1-5.0gitb0a953ad.ns6.noarch.rpm
nethserver-base-1.4.3-7.0gitb36cc20c.ns6.noarch.rpm
nethserver-nethgui-1.2.4-10.0gitb5e24fb9.ns6.noarch.rpm

#11 Updated by Davide Principi over 7 years ago

  • Assignee set to Davide Principi

#12 Updated by Davide Principi over 7 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

#13 Updated by Davide Principi over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#14 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

#15 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-lib-1.3.2-15.2.0gitd94eb9dd.ns6.noarch
nethserver-yum-1.1.1-7.2.0gitab2ec6f0.ns6.noarch
sogo-frontends-1.1.0-1.0git772fa618.ns6.noarch

#16 Updated by Giacomo Sanchietti over 7 years ago

  • Assignee set to Giacomo Sanchietti

#17 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 20
Actual implementation does not:
  • track packages download
  • handle errors

#18 Updated by Davide Principi over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30
  • Estimated time changed from 96.00 to 104.00

#19 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#20 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-yum-1.1.1-10.0gitc362c760.ns6.noarch.rpm
nethserver-base-1.4.3-13.0git8b6b85b0.ns6.noarch.rpm

#21 Updated by Giacomo Sanchietti over 7 years ago

  • Assignee set to Giacomo Sanchietti

#22 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90
Works like a charm. The package manager tracks:
  • progress of rpm downloading
  • progress of rpm transactions
  • progress of events
Two error scenarios:
  • an error occurs during yum transaction: the messages is displayed inside the UI. Example:
    Message from the install process: Errors were encountered while downloading packages. nethserver-ejabberd-1.0.2-1.ns6.noarch: [ ... ]: [Errno 256] No more mirrors to try.
    
  • an error occurs during events: a general message is displayed inside the UI, for further information you need to open /var/log/messages

Marking as VERIFIED.

#23 Updated by Davide Principi over 7 years ago

  • Status changed from VERIFIED to CLOSED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-samba-1.4.0-1.ns6.noarch.rpm
nethserver-directory-1.3.0-1.ns6.noarch.rpm
nethserver-dnsmasq-1.1.0-1.ns6.noarch.rpm
nethserver-shorewall-1.0.3-1.ns6.noarch.rpm
nethserver-mail-server-1.5.0-1.ns6.noarch.rpm
nethserver-mail-filter-1.1.4-1.ns6.noarch.rpm
nethserver-nethgui-1.3.0-1.ns6.noarch.rpm
nethserver-base-1.5.0-1.ns6.noarch.rpm
nethserver-lib-1.4.0-1.ns6.noarch.rpm
nethserver-httpd-admin-1.1.0-1.ns6.noarch.rpm
nethserver-yum-1.2.0-1.ns6.noarch.rpm
nethserver-ntopng-1.1.0-1.ns6.noarch.rpm

sogo-frontends-1.1.1-1.ns6.noarch.rpm

Also available in: Atom PDF