incubator-ariatosca git commit: fix1 [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution 95cc3d100 -> aea7cebc8 (forced update) fix1 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/aea7cebc Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/aea7cebc Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/aea7cebc Branch: refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution Commit: aea7cebc8789d5b76844f87bf31f2a87af0b3429 Parents: 57555fe Author: max-orlovAuthored: Mon May 22 19:07:37 2017 +0300 Committer: max-orlov Committed: Mon May 22 22:54:39 2017 +0300 -- aria/orchestrator/context/common.py| 4 aria/orchestrator/context/operation.py | 17 ++--- .../execution_plugin/ctx_proxy/server.py | 2 +- aria/orchestrator/workflows/executor/process.py| 3 +-- .../execution_plugin/test_ctx_proxy_server.py | 3 ++- tests/orchestrator/workflows/executor/__init__.py | 6 +- 6 files changed, 23 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aea7cebc/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index 3918408..c98e026 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -194,7 +194,3 @@ class BaseContext(object): variables.setdefault('ctx', self) resource_template = jinja2.Template(resource_content) return resource_template.render(variables) - -def _teardown_db_resources(self): -self.model.log._session.remove() -self.model.log._engine.dispose() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aea7cebc/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 68a02aa..e0eb927 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -29,10 +29,11 @@ class BaseOperationContext(BaseContext): Context object used during operation creation and execution """ -def __init__(self, task_id, actor_id, **kwargs): +def __init__(self, task_id, actor_id, instantiated_from_dict=False, **kwargs): self._task_id = task_id self._actor_id = actor_id self._thread_local = threading.local() +self._instantiated_from_dict = instantiated_from_dict logger_level = kwargs.pop('logger_level', None) super(BaseOperationContext, self).__init__(**kwargs) self._register_logger(task_id=self.task.id, level=logger_level) @@ -90,14 +91,24 @@ class BaseOperationContext(BaseContext): } @classmethod -def deserialize_from_dict(cls, model_storage=None, resource_storage=None, **kwargs): +def instantiate_from_dict(cls, model_storage=None, resource_storage=None, **kwargs): if model_storage: model_storage = aria.application_model_storage(**model_storage) if resource_storage: resource_storage = aria.application_resource_storage(**resource_storage) -return cls(model_storage=model_storage, resource_storage=resource_storage, **kwargs) +return cls(model_storage=model_storage, + resource_storage=resource_storage, + instantiated_from_dict=True, + **kwargs) +def __del__(self): +self.close() + +def close(self): +if self._instantiated_from_dict: +self.model.log._session.remove() +self.model.log._engine.dispose() class NodeOperationContext(BaseOperationContext): """ http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aea7cebc/aria/orchestrator/execution_plugin/ctx_proxy/server.py -- diff --git a/aria/orchestrator/execution_plugin/ctx_proxy/server.py b/aria/orchestrator/execution_plugin/ctx_proxy/server.py index ef25491..e3496b9 100644 --- a/aria/orchestrator/execution_plugin/ctx_proxy/server.py +++ b/aria/orchestrator/execution_plugin/ctx_proxy/server.py @@ -128,7 +128,7 @@ class CtxProxy(object): finally: # Since this runs in a daemon thread, we need to close the session each time we process # a request (a new session would be supplied by SQLAlchemy scoped_session). -# log mapi is chosen randomly. +# log mapi is chosen
incubator-ariatosca git commit: fix1 [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution 1f093d06f -> 95cc3d100 (forced update) fix1 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/95cc3d10 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/95cc3d10 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/95cc3d10 Branch: refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution Commit: 95cc3d1002889e2b83a19fc6b620bdf9d77245b0 Parents: 57555fe Author: max-orlovAuthored: Mon May 22 19:07:37 2017 +0300 Committer: max-orlov Committed: Mon May 22 22:34:36 2017 +0300 -- aria/orchestrator/context/common.py| 4 aria/orchestrator/context/operation.py | 17 ++--- .../execution_plugin/ctx_proxy/server.py | 2 +- aria/orchestrator/workflows/executor/process.py| 3 +-- .../execution_plugin/test_ctx_proxy_server.py | 3 ++- tests/orchestrator/workflows/executor/__init__.py | 6 +- 6 files changed, 23 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/95cc3d10/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index 3918408..c98e026 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -194,7 +194,3 @@ class BaseContext(object): variables.setdefault('ctx', self) resource_template = jinja2.Template(resource_content) return resource_template.render(variables) - -def _teardown_db_resources(self): -self.model.log._session.remove() -self.model.log._engine.dispose() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/95cc3d10/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 68a02aa..e0eb927 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -29,10 +29,11 @@ class BaseOperationContext(BaseContext): Context object used during operation creation and execution """ -def __init__(self, task_id, actor_id, **kwargs): +def __init__(self, task_id, actor_id, instantiated_from_dict=False, **kwargs): self._task_id = task_id self._actor_id = actor_id self._thread_local = threading.local() +self._instantiated_from_dict = instantiated_from_dict logger_level = kwargs.pop('logger_level', None) super(BaseOperationContext, self).__init__(**kwargs) self._register_logger(task_id=self.task.id, level=logger_level) @@ -90,14 +91,24 @@ class BaseOperationContext(BaseContext): } @classmethod -def deserialize_from_dict(cls, model_storage=None, resource_storage=None, **kwargs): +def instantiate_from_dict(cls, model_storage=None, resource_storage=None, **kwargs): if model_storage: model_storage = aria.application_model_storage(**model_storage) if resource_storage: resource_storage = aria.application_resource_storage(**resource_storage) -return cls(model_storage=model_storage, resource_storage=resource_storage, **kwargs) +return cls(model_storage=model_storage, + resource_storage=resource_storage, + instantiated_from_dict=True, + **kwargs) +def __del__(self): +self.close() + +def close(self): +if self._instantiated_from_dict: +self.model.log._session.remove() +self.model.log._engine.dispose() class NodeOperationContext(BaseOperationContext): """ http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/95cc3d10/aria/orchestrator/execution_plugin/ctx_proxy/server.py -- diff --git a/aria/orchestrator/execution_plugin/ctx_proxy/server.py b/aria/orchestrator/execution_plugin/ctx_proxy/server.py index ef25491..e3496b9 100644 --- a/aria/orchestrator/execution_plugin/ctx_proxy/server.py +++ b/aria/orchestrator/execution_plugin/ctx_proxy/server.py @@ -128,7 +128,7 @@ class CtxProxy(object): finally: # Since this runs in a daemon thread, we need to close the session each time we process # a request (a new session would be supplied by SQLAlchemy scoped_session). -# log mapi is chosen randomly. +# log mapi is chosen