[01/10] incubator-ariatosca git commit: ARIA-213 sporadic tests failures over locked database issue [Forced Update!]

2017-06-16 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-254-multiple-nodes-per-template f5f5852ad -> 76aa0843f 
(forced update)


ARIA-213 sporadic tests failures over locked database issue

Increased the timeout for acquiring database lock (for sqlite based db).


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/cd830731
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/cd830731
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/cd830731

Branch: refs/heads/ARIA-254-multiple-nodes-per-template
Commit: cd830731bff21e836b5e661623b269aa40f92f52
Parents: 180e0a1
Author: max-orlov 
Authored: Tue Jun 6 17:05:21 2017 +0300
Committer: max-orlov 
Committed: Wed Jun 7 17:21:01 2017 +0300

--
 aria/storage/sql_mapi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cd830731/aria/storage/sql_mapi.py
--
diff --git a/aria/storage/sql_mapi.py b/aria/storage/sql_mapi.py
index 4d7e233..bb6223a 100644
--- a/aria/storage/sql_mapi.py
+++ b/aria/storage/sql_mapi.py
@@ -405,7 +405,8 @@ def init_storage(base_dir, filename='db.sqlite'):
 
 path=os.path.join(base_dir, filename))
 
-engine = create_engine(uri)
+engine = create_engine(uri, connect_args=dict(timeout=15))
+
 session_factory = orm.sessionmaker(bind=engine)
 session = orm.scoped_session(session_factory=session_factory)
 



[01/13] incubator-ariatosca git commit: ARIA-213 sporadic tests failures over locked database issue [Forced Update!]

2017-06-07 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-275-update-NFV-profile-to-csd04 5e8044d4b -> 9240e20ec 
(forced update)


ARIA-213 sporadic tests failures over locked database issue

Increased the timeout for acquiring database lock (for sqlite based db).


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/cd830731
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/cd830731
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/cd830731

Branch: refs/heads/ARIA-275-update-NFV-profile-to-csd04
Commit: cd830731bff21e836b5e661623b269aa40f92f52
Parents: 180e0a1
Author: max-orlov 
Authored: Tue Jun 6 17:05:21 2017 +0300
Committer: max-orlov 
Committed: Wed Jun 7 17:21:01 2017 +0300

--
 aria/storage/sql_mapi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cd830731/aria/storage/sql_mapi.py
--
diff --git a/aria/storage/sql_mapi.py b/aria/storage/sql_mapi.py
index 4d7e233..bb6223a 100644
--- a/aria/storage/sql_mapi.py
+++ b/aria/storage/sql_mapi.py
@@ -405,7 +405,8 @@ def init_storage(base_dir, filename='db.sqlite'):
 
 path=os.path.join(base_dir, filename))
 
-engine = create_engine(uri)
+engine = create_engine(uri, connect_args=dict(timeout=15))
+
 session_factory = orm.sessionmaker(bind=engine)
 session = orm.scoped_session(session_factory=session_factory)
 



[1/2] incubator-ariatosca git commit: ARIA-213 sporadic tests failures over locked database issue [Forced Update!]

2017-06-07 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-199-cli-service-output 3e8186ba4 -> 5afa2f7fe (forced update)


ARIA-213 sporadic tests failures over locked database issue

Increased the timeout for acquiring database lock (for sqlite based db).


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/cd830731
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/cd830731
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/cd830731

Branch: refs/heads/ARIA-199-cli-service-output
Commit: cd830731bff21e836b5e661623b269aa40f92f52
Parents: 180e0a1
Author: max-orlov 
Authored: Tue Jun 6 17:05:21 2017 +0300
Committer: max-orlov 
Committed: Wed Jun 7 17:21:01 2017 +0300

--
 aria/storage/sql_mapi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cd830731/aria/storage/sql_mapi.py
--
diff --git a/aria/storage/sql_mapi.py b/aria/storage/sql_mapi.py
index 4d7e233..bb6223a 100644
--- a/aria/storage/sql_mapi.py
+++ b/aria/storage/sql_mapi.py
@@ -405,7 +405,8 @@ def init_storage(base_dir, filename='db.sqlite'):
 
 path=os.path.join(base_dir, filename))
 
-engine = create_engine(uri)
+engine = create_engine(uri, connect_args=dict(timeout=15))
+
 session_factory = orm.sessionmaker(bind=engine)
 session = orm.scoped_session(session_factory=session_factory)
 



incubator-ariatosca git commit: ARIA-213 sporadic tests failures over locked database issue [Forced Update!]

2017-06-07 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
ceb1c0525 -> cd830731b (forced update)


ARIA-213 sporadic tests failures over locked database issue

Increased the timeout for acquiring database lock (for sqlite based db).


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/cd830731
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/cd830731
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/cd830731

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: cd830731bff21e836b5e661623b269aa40f92f52
Parents: 180e0a1
Author: max-orlov 
Authored: Tue Jun 6 17:05:21 2017 +0300
Committer: max-orlov 
Committed: Wed Jun 7 17:21:01 2017 +0300

--
 aria/storage/sql_mapi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cd830731/aria/storage/sql_mapi.py
--
diff --git a/aria/storage/sql_mapi.py b/aria/storage/sql_mapi.py
index 4d7e233..bb6223a 100644
--- a/aria/storage/sql_mapi.py
+++ b/aria/storage/sql_mapi.py
@@ -405,7 +405,8 @@ def init_storage(base_dir, filename='db.sqlite'):
 
 path=os.path.join(base_dir, filename))
 
-engine = create_engine(uri)
+engine = create_engine(uri, connect_args=dict(timeout=15))
+
 session_factory = orm.sessionmaker(bind=engine)
 session = orm.scoped_session(session_factory=session_factory)
 



incubator-ariatosca git commit: ARIA-213 Sporadic tests failures over locked database issue [Forced Update!]

2017-05-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
2920661ac -> 2ee06b8a6 (forced update)


ARIA-213 Sporadic tests failures over locked database issue

Move from 2 different sessions - one for the log, and the other for general 
model operations,
to one single session, while utilizing the keep tracking of changes mechanism 
for both logs and node/task states.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2ee06b8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2ee06b8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2ee06b8a

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: 2ee06b8a6abe79f429458c7dbc5f9e1c31aec589
Parents: 6864d42
Author: max-orlov 
Authored: Tue May 9 17:24:31 2017 +0300
Committer: max-orlov 
Committed: Thu May 11 17:24:15 2017 +0300

--
 aria/logger.py  | 25 +
 aria/orchestrator/context/common.py | 13 +--
 .../workflows/core/events_handler.py|  4 +-
 aria/orchestrator/workflows/executor/process.py | 51 ++
 aria/storage/instrumentation.py | 97 +---
 .../orchestrator/workflows/executor/__init__.py | 21 -
 .../workflows/executor/test_executor.py | 36 ++--
 .../workflows/executor/test_process_executor.py | 13 ++-
 tests/storage/test_instrumentation.py   | 37 +++-
 9 files changed, 219 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2ee06b8a/aria/logger.py
--
diff --git a/aria/logger.py b/aria/logger.py
index 97d3878..bd7ed4e 100644
--- a/aria/logger.py
+++ b/aria/logger.py
@@ -114,17 +114,11 @@ def create_console_log_handler(level=logging.DEBUG, 
formatter=None):
 return console
 
 
-def create_sqla_log_handler(session, engine, log_cls, execution_id, 
level=logging.DEBUG):
+def create_sqla_log_handler(model, log_cls, execution_id, level=logging.DEBUG):
 
 # This is needed since the engine and session are entirely new we need to 
reflect the db
 # schema of the logging model into the engine and session.
-log_cls.__table__.create(bind=engine, checkfirst=True)
-
-return _SQLAlchemyHandler(session=session,
-  engine=engine,
-  log_cls=log_cls,
-  execution_id=execution_id,
-  level=level)
+return _SQLAlchemyHandler(model=model, log_cls=log_cls, 
execution_id=execution_id, level=level)
 
 
 class _DefaultConsoleFormat(logging.Formatter):
@@ -168,10 +162,9 @@ def create_file_log_handler(
 
 class _SQLAlchemyHandler(logging.Handler):
 
-def __init__(self, session, engine, log_cls, execution_id, **kwargs):
+def __init__(self, model, log_cls, execution_id, **kwargs):
 logging.Handler.__init__(self, **kwargs)
-self._session = session
-self._engine = engine
+self._model = model
 self._cls = log_cls
 self._execution_id = execution_id
 
@@ -188,15 +181,7 @@ class _SQLAlchemyHandler(logging.Handler):
 # Not mandatory.
 traceback=getattr(record, 'traceback', None)
 )
-self._session.add(log)
-
-try:
-self._session.commit()
-except BaseException:
-self._session.rollback()
-raise
-finally:
-self._session.close()
+self._model.log.put(log)
 
 
 _default_file_formatter = logging.Formatter(

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2ee06b8a/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index 64ef9a4..0854a27 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -79,13 +79,9 @@ class BaseContext(object):
 self.logger.addHandler(self._get_sqla_handler())
 
 def _get_sqla_handler(self):
-api_kwargs = {}
-if self._model._initiator:
-
api_kwargs.update(self._model._initiator(**self._model._initiator_kwargs))
-api_kwargs.update(**self._model._api_kwargs)
-return aria_logger.create_sqla_log_handler(log_cls=modeling.models.Log,
-   
execution_id=self._execution_id,
-   **api_kwargs)
+return aria_logger.create_sqla_log_handler(model=self._model,
+   log_cls=modeling.mo

incubator-ariatosca git commit: ARIA-213 Sporadic tests failures over locked database issue [Forced Update!]

2017-05-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
0632e07c2 -> 2920661ac (forced update)


ARIA-213 Sporadic tests failures over locked database issue

In this PR we moved from 2 different sessions - one for the log, and the other 
for general model operations,
to one single sessions, while utilizing the keep tracking of changes mechanism 
for both logs and node/task states.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2920661a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2920661a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2920661a

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: 2920661ac63a2ceb937ae8caf75b610968bdeb11
Parents: 6864d42
Author: max-orlov 
Authored: Tue May 9 17:24:31 2017 +0300
Committer: max-orlov 
Committed: Thu May 11 17:14:52 2017 +0300

--
 aria/logger.py  | 25 +
 aria/orchestrator/context/common.py | 13 +--
 .../workflows/core/events_handler.py|  4 +-
 aria/orchestrator/workflows/executor/process.py | 51 ++
 aria/storage/instrumentation.py | 97 +---
 .../orchestrator/workflows/executor/__init__.py | 21 -
 .../workflows/executor/test_executor.py | 36 ++--
 .../workflows/executor/test_process_executor.py | 13 ++-
 tests/storage/test_instrumentation.py   | 37 +++-
 9 files changed, 219 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2920661a/aria/logger.py
--
diff --git a/aria/logger.py b/aria/logger.py
index 97d3878..bd7ed4e 100644
--- a/aria/logger.py
+++ b/aria/logger.py
@@ -114,17 +114,11 @@ def create_console_log_handler(level=logging.DEBUG, 
formatter=None):
 return console
 
 
-def create_sqla_log_handler(session, engine, log_cls, execution_id, 
level=logging.DEBUG):
+def create_sqla_log_handler(model, log_cls, execution_id, level=logging.DEBUG):
 
 # This is needed since the engine and session are entirely new we need to 
reflect the db
 # schema of the logging model into the engine and session.
-log_cls.__table__.create(bind=engine, checkfirst=True)
-
-return _SQLAlchemyHandler(session=session,
-  engine=engine,
-  log_cls=log_cls,
-  execution_id=execution_id,
-  level=level)
+return _SQLAlchemyHandler(model=model, log_cls=log_cls, 
execution_id=execution_id, level=level)
 
 
 class _DefaultConsoleFormat(logging.Formatter):
@@ -168,10 +162,9 @@ def create_file_log_handler(
 
 class _SQLAlchemyHandler(logging.Handler):
 
-def __init__(self, session, engine, log_cls, execution_id, **kwargs):
+def __init__(self, model, log_cls, execution_id, **kwargs):
 logging.Handler.__init__(self, **kwargs)
-self._session = session
-self._engine = engine
+self._model = model
 self._cls = log_cls
 self._execution_id = execution_id
 
@@ -188,15 +181,7 @@ class _SQLAlchemyHandler(logging.Handler):
 # Not mandatory.
 traceback=getattr(record, 'traceback', None)
 )
-self._session.add(log)
-
-try:
-self._session.commit()
-except BaseException:
-self._session.rollback()
-raise
-finally:
-self._session.close()
+self._model.log.put(log)
 
 
 _default_file_formatter = logging.Formatter(

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2920661a/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index 64ef9a4..0854a27 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -79,13 +79,9 @@ class BaseContext(object):
 self.logger.addHandler(self._get_sqla_handler())
 
 def _get_sqla_handler(self):
-api_kwargs = {}
-if self._model._initiator:
-
api_kwargs.update(self._model._initiator(**self._model._initiator_kwargs))
-api_kwargs.update(**self._model._api_kwargs)
-return aria_logger.create_sqla_log_handler(log_cls=modeling.models.Log,
-   
execution_id=self._execution_id,
-   **api_kwargs)
+return aria_logger.create_sqla_log_handler(model=self._model,
+   log