Skip to content

Commit

Permalink
query logging exception check (#5630)
Browse files Browse the repository at this point in the history
* Don't inspect the ColumnLogging object if an error was encountered.
The error is only relevant if detailed logging is enabled and it will reported later.
  • Loading branch information
labkey-matthewb authored Jun 29, 2024
1 parent 9af2048 commit 7e582e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions api/src/org/labkey/api/data/MaterializedQueryHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ void reset()
/** return false if we did not acquire the loadingLock */
boolean load(SQLFragment selectQuery, boolean isSelectInto)
{
boolean lockAquired = false;
try
{
try
{
if (!_loadingLock.tryLock(5, TimeUnit.MINUTES))
if (!(lockAquired = _loadingLock.tryLock(5, TimeUnit.MINUTES)))
return false;
}
catch (InterruptedException x)
Expand Down Expand Up @@ -162,7 +163,8 @@ boolean load(SQLFragment selectQuery, boolean isSelectInto)
}
finally
{
_loadingLock.unlock();
if (lockAquired)
_loadingLock.unlock();
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions query/src/org/labkey/query/sql/QueryTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,12 @@ public Set<RelationColumn> getSuggestedColumns(Set<RelationColumn> selected)
}

ColumnLogging columnLogging = col.getColumnLogging();
for (FieldKey fieldKey : columnLogging.getDataLoggingColumns())
if (null == columnLogging.getException())
{
addSuggestedColumn(suggested, fieldKey, selectedColumnMap);
for (FieldKey fieldKey : columnLogging.getDataLoggingColumns())
{
addSuggestedColumn(suggested, fieldKey, selectedColumnMap);
}
}
}
suggested.removeAll(selected);
Expand Down

0 comments on commit 7e582e9

Please sign in to comment.