Changeset 4498 for branches/2.8-stable


Ignore:
Timestamp:
Sep 10, 2008, 11:06:57 AM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1117: Job agents don't allow a job to be executed when the owner is missing permission to the "active project"

Location:
branches/2.8-stable/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8-stable/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java

    r4496 r4498  
    754754        catch (Throwable t)
    755755        {
    756           log.error("Exception while setting active project to " + projectId +
    757             ". Continuing with no active project.", t);
     756          log.warn("Exception while setting active project to Project[id=" + projectId +
     757            "]. Continuing with no active project.", t);
    758758        }
    759759      }
  • branches/2.8-stable/src/clients/jobagent/net/sf/basedb/clients/jobagent/executors/ThreadJobExecutor.java

    r4497 r4498  
    183183     
    184184      impersonated = sc.impersonateLogin(job, "Running job: " + job.getName());
    185       if (job.getActiveProjectId() != 0)
     185      int projectId = job.getActiveProjectId();
     186      if (projectId != 0)
    186187      {
    187188        dc = impersonated.newDbControl();
    188         Project activeProject = Project.getById(dc, job.getActiveProjectId());
    189         impersonated.setActiveProject(activeProject);
     189        try
     190        {
     191          Project activeProject = Project.getById(dc, projectId);
     192          impersonated.setActiveProject(activeProject);
     193        }
     194        catch (Throwable t)
     195        {
     196          log.warn("Exception while setting active project to Project[id=" + projectId +
     197              "]. Continuing with no active project.", t);
     198        }
    190199        dc.close();
    191200      }
  • branches/2.8-stable/src/core/net/sf/basedb/core/InternalJobQueue.java

    r4479 r4498  
    483483          catch (Throwable t)
    484484          {
    485             log.error("Exception while setting active project. Continuing with no active project.", t);
     485            log.warn("Exception while setting active project to Project[id=" + projectId +
     486                "]. Continuing with no active project.", t);
    486487          }
    487488        }
Note: See TracChangeset for help on using the changeset viewer.