Commit Graph

15 Commits

Author SHA1 Message Date
421ec4b658 Only stop task if task-to-stop is the same as currently-executing-task
The 'may-i-run' endpoint may say 'no' to us running task X, but when the
response comes in and is handled the worker may already be working on task
Y. This case is now recognised, and the 'no' will be ignored.
2018-11-16 15:45:39 +01:00
a350ed2e5a Absolute imports for tests to make PyCharm happy 2018-11-15 13:52:05 +01:00
826f53b345 Changed from 'task' to 'future'
This makes a clearer distinction between Flamenco tasks ('task') and
AsyncIO tasks ('future'). The AsyncIO Task class is a subclass of its
Future class.
2018-11-15 11:43:37 +01:00
9e55ccd6af Moved from requirements.txt to Pipfile
This also means that we need a `tests/__init__.py` file; this file makes
py.test undertand what is our sources directory, and thus allows them to
`import flamenco_worker`. As a result, the test imports from tests/*.py
need to change to relative imports.
2018-11-13 10:00:58 +01:00
155d91c562 Split Worker.fetch_task() into fetch_task() and execute_task()
This makes the naming more consistent, and makes it easier to add more
functionality without growing an already-big function.
2018-11-12 09:33:48 +01:00
e8a4093104 Fix memory leak in task update queue
I'm guessing the do_db_push() async function execution was starved by
other asyncio tasks, causing Python to remember all the to-be-queued
payloads in memory. By making the function synchronous this doesn't happen.
2018-06-15 14:18:24 +02:00
a4bb3718aa Quick slap hack: refuse to fetch tasks when outgoing queue is full
This should prevent an accumulation of task updates, when the updates
are generated faster than they can be sent to the Manager.
2018-04-18 10:30:27 +02:00
7be0ae2e8a Fix unittest 2017-12-15 17:17:18 +01:00
ea49ddc264 Implemented Manager-dictated state changes.
The Manager can now dictate that the Worker moves to an 'asleep' state.
2017-10-19 18:57:06 +02:00
3838f56b12 Don't push task status 'canceled' when we are no longer allowed to run it.
When the "may I run" system says "no", we shouldn't push a "canceled"
status to the Manager, as this could overwrite another valid status that's
there for some other reason.
2017-09-29 14:45:58 +02:00
c07105e04e Renamed flush_for_shutdown() to flush_and_report()
It'll be called in non-shutdown situations too.
2017-09-29 12:32:01 +02:00
9c8d6e01fb Properly fixed futures not being waited for. 2017-09-06 17:14:49 +02:00
337e77b64e Sign on at Manager when starting Worker
This passes the current hostname and list of supported task types to the
manager.
2017-03-31 17:24:46 +02:00
95b4f13741 Replaced job_types → task_types
This allows a finer granularity of task selection for a given worker.
2017-03-31 16:04:18 +02:00
4d9819c92f Removed Flamenco Server and Manager, and moved Worker to top level
This is a clone of the Flamenco repository from back in the days when
Server, Manager and Worker shared the same Git repository. This is the
commit where that ended, and they went their separate ways.
2017-03-03 16:13:09 +01:00