Commit Graph

30 Commits

Author SHA1 Message Date
Girish Ramakrishnan
87584be484 restartAppTask when resuming tasks
We end up with duplicate tasks because the auto installer might
have queued up some pending_install tasks on start up.
2016-06-21 10:56:25 -05:00
Girish Ramakrishnan
5a61c5ba51 platform: ready event 2016-06-21 10:46:02 -05:00
Girish Ramakrishnan
fbf7e6804f add note for resuming tasks 2016-06-21 10:33:38 -05:00
Girish Ramakrishnan
1e54581c40 clear timer 2016-06-20 22:39:11 -05:00
Girish Ramakrishnan
6bc14ea7e4 resumeTasks only when configured and platform ready 2016-06-20 14:46:52 -05:00
Girish Ramakrishnan
26f318477b Do not send crash logs for apptask cancellations 2016-06-14 14:13:47 -07:00
Girish Ramakrishnan
5e9ea98b66 ignore apps in errored state 2016-04-20 19:05:49 -07:00
Girish Ramakrishnan
eadff099eb send logs when apptask fails 2016-04-19 18:40:46 -07:00
Girish Ramakrishnan
15653cb3f8 rename to logcollector 2016-04-19 18:13:05 -07:00
Girish Ramakrishnan
dad1585704 send crash notification on apptask crash 2016-04-19 16:43:58 -07:00
Girish Ramakrishnan
5fa974ffe6 wait for 30 seconds in taskmanager instead
problem: because the apps are not inserted into appdb, the cloudron starts out
with an empty view. apps appear suddenly after 30 seconds.

besides, it makes more sense because 30 secs is not really tied to first run
2016-04-19 13:56:41 -07:00
girish@cloudron.io
1fb26bc441 make startAppTask take a callback 2016-02-09 12:14:04 -08:00
girish@cloudron.io
e6d23a9701 stop previous task explicitly
there is a race:
1. task is running
2. new task is created overwriting the installationState
3. new task kills the old task of step 1. this results in installationState getting overwritten by 'error' because of the sigkill
4. new task that is launched loses the installationState that was step in 2.
2016-02-09 12:09:20 -08:00
girish@cloudron.io
0785266741 kill immediately. by default, it sends SIGTERM 2016-02-09 12:03:21 -08:00
Johannes Zellner
05245f5fc7 Add a way to wait and stop pending tasks 2016-01-29 16:25:31 +01:00
girish@cloudron.io
bcb0e61bfc Kill child processes
On Unix, child processes are not killed when parent dies.

Each process is part of a process group (pgid). When pgid == pid,
it is the process group leader.

node creates child processes with the parent as the group leader
(detached = false).

You can send a signal to entire group using kill(-pgid), as in,
negative value in argument. Systemd can be made to do this by
setting the KillMode=control-group.

Unrelated: Process groups reside inside session groups. Each session
group has a controlling terminal. Only one process in the session
group has access to the terminal. Process group is basically like
a bash pipeline. A session group is the entire login session with only
one process having terminal access at a time.

Fixes #543
2016-01-21 17:44:17 -08:00
Girish Ramakrishnan
8ead0e662a detect apptask crashes 2015-12-14 19:11:26 -08:00
Girish Ramakrishnan
9c549ed4d8 wait for old apptask to finish before starting new one
kill() is async and takes no callback :/
2015-11-09 22:10:10 -08:00
Girish Ramakrishnan
61fc8b7968 better taskmanager debugs 2015-11-09 21:58:34 -08:00
Girish Ramakrishnan
b1dbb3570b Add configured event
Cloudron code paths like cron/mailer/taskmanager now wait for configuration
to be complete before doing anything.

This is useful when a cloudron is moved from a non-custom domain to a custom domain.
In that case, we require route53 configs.
2015-11-03 16:06:38 -08:00
Girish Ramakrishnan
612ceba98a unsubscribe from events 2015-11-03 15:19:06 -08:00
Girish Ramakrishnan
7d5e0040bc debug only if error 2015-11-03 15:15:37 -08:00
Girish Ramakrishnan
d6e19d2000 resume tasks only if cloudron is activated 2015-11-03 15:14:59 -08:00
Girish Ramakrishnan
a01d5db2a0 minor refactor 2015-11-02 17:45:38 -08:00
Girish Ramakrishnan
0877cec2e6 Fix EE leak warning 2015-09-29 14:40:23 -07:00
Girish Ramakrishnan
e97b9fcc60 Do not start apptask for apps that are installed and running 2015-09-08 10:24:39 -07:00
Girish Ramakrishnan
71fe643099 Check if we have reached concurrency limit before locking 2015-09-08 10:20:34 -07:00
Girish Ramakrishnan
b3816615db run upto 5 apptasks in parallel
fixes #482
2015-09-05 09:17:46 -07:00
Johannes Zellner
019d29c5b7 Use assert.strictEqual() to see the values 2015-08-05 17:49:19 +02:00
Girish Ramakrishnan
df9d321ac3 app.portBindings and newManifest.tcpPorts may be null 2015-07-20 00:10:36 -07:00