[GRADLE-1933] tooling api is not thread safe even if no instances are shared Created: 16/Nov/11  Updated: 04/Jan/13  Resolved: 19/Dec/11

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.0-milestone-7

Type: Bug
Reporter: Szczepan Faber Assignee: Szczepan Faber
Resolution: Fixed Votes: 0


 Description   
Problem

Tooling-api is not thread safe even if the client does not reuse any instances of connector or projectConnection. The use case from the NetBeans plugin (note that no instances are shared):

  1. Thread 1:
    //getting tasks to fill up the tasks navigation panel
    GradleConnector gradleConnector = GradleConnector.newConnector();
    //...
    projectConnection.getModel(BuildableProject.class);
    
  2. Thread 2:
    //running a particular task:
    GradleConnector gradleConnector = GradleConnector.newConnector();
    //...
    buildLauncher.run();
    
Symptoms

Before fixing the GRADLE-1797 I was able to expose this issue in the initial version of Gradle NetBeans plugin. Steps to reproduce:

  1. start NB gradle plugin
  2. click on build.gradle
  3. double click on any of the tasks to run a task. It is reproducible most of the time. Some exception is thrown. However, if you first single click on the task (the task list is refreshed internally by the plugin), wait few secs, then double click to run, all will work fine.


 Comments   
Comment by Adam Murdoch [ 19/Dec/11 ]

reopening so I can fix the 'fix for' field.

Generated at Wed Jun 30 12:08:16 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.