crossminer / scava

https://eclipse.org/scava/
Eclipse Public License 2.0
18 stars 13 forks source link

Issues creating and starting tasks #398

Open MarcioMateus opened 4 years ago

MarcioMateus commented 4 years ago

Dear all,

Let us share with you some problems and findings we had.

In our use case we have a program that consumes the CROSSMINER API. We have a process to 1) import a project into CROSSMINER, 2)create an analysis task and 3) start the task. This procedure has executed multiple times until all of our projects were on CROSSMINER.

However, after some version of the platform (we don't know which), we started getting errors on platform like the one reported in https://github.com/crossminer/scava/issues/341. Basically, a HTTP 500 error is sent by the platform whenever the platform tries to get the analysis task of some projects.

After looking into the DB it seems that the problem was on the creation of metricExecutions, since on the projects with errors the number of metricExecutions was lesser than the number of metric providers identified on the analysis task. This was making the dashboard unable to represent the status of those analysis task and made us unable to start the tasks using the API. Projects in this state are always with the status Not defined on the dashboard

After checking our code many times and trying different approaches, we where able to import all project with success by 1) importing a project, 2) creating the analysis task for the project. Only after all projects were imported, did we 3) start all analysis tasks.

We also saw those errors when manually doing the project import, task creation and start, using the administration dashboard and running multiple workers.

Our guess is that the platform may have a thread management bug that sometimes conflicts with the process of creation the metricExecutions required to execute analysis tasks.