Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/unomi-ci-build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -47,9 +47,9 @@ jobs:
port: 9401
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -71,7 +71,7 @@ jobs:
./build.sh --ci --integration-tests
fi
- name: Archive IT memory metrics
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
if: always()
with:
name: it-memory-metrics-jdk17-${{ matrix.search-engine }}-${{ github.run_number }}
Expand All @@ -81,13 +81,13 @@ jobs:
itests/target/memory-sampler.log
if-no-files-found: ignore
- name: Archive code coverage logs
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
if: false # UNOMI-746 Reactivate if necessary
with:
name: unomi-code-coverage-jdk17-${{ matrix.search-engine }}-${{ github.run_number }}
path: itests/target/site/jacoco
- name: Archive unomi logs
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
if: failure()
with:
name: unomi-log-jdk17-${{ matrix.search-engine }}-${{ github.run_number }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unomi-ci-docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Publish Javadoc and snapshots
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
Expand All @@ -40,7 +40,7 @@ jobs:
name: Push Docker image snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unomi-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -35,7 +35,7 @@ jobs:
mvn -U -ntp clean install

- name: Archive documentation
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: unomi-documentation
path: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,16 @@ public void remove(String actionName) {

LOGGER.info("Removing script: {}", actionName);

Map<String, ScriptMetadata> scriptMetadataMap = getScriptMetadataMap();

ScriptMetadata removedMetadata = scriptMetadataMap.remove(actionName);
// Snapshot the metadata before the locked removal so we can extract the @Action
// annotation id for the definitions-service cleanup below. The actual removal
// from scriptMetadataCacheByTenant happens inside onItemRemoved(), which runs
// while the type-refresh read lock is held, preventing a concurrent cache refresh
// from re-inserting the entry between the removal and any subsequent lookup.
String tenantId = contextManager.getCurrentContext().getTenantId();
Map<String, ScriptMetadata> scriptMetadataMap = scriptMetadataCacheByTenant.get(tenantId);
ScriptMetadata removedMetadata = scriptMetadataMap != null ? scriptMetadataMap.get(actionName) : null;

// Clean up error tracking to prevent memory leak
String tenantId = contextManager.getCurrentContext().getTenantId();
Set<String> tenantErrors = loggedRefreshErrors.get(tenantId);
if (tenantErrors != null) {
tenantErrors.remove(actionName);
Expand All @@ -601,7 +605,8 @@ public void remove(String actionName) {
}
}

// Remove from persistent storage and cache
// Remove from persistent storage and cache; onItemRemoved() removes from
// scriptMetadataCacheByTenant under the type-refresh read lock.
removeItem(actionName, GroovyAction.class, GroovyAction.ITEM_TYPE);

if (removedMetadata != null) {
Expand All @@ -614,6 +619,16 @@ public void remove(String actionName) {
LOGGER.info("Script {} removed successfully", actionName);
}

@Override
protected void onItemRemoved(String id, String itemType, String tenantId) {
if (GroovyAction.ITEM_TYPE.equals(itemType)) {
Map<String, ScriptMetadata> map = scriptMetadataCacheByTenant.get(tenantId);
if (map != null) {
map.remove(id);
}
}
}

@Override
public Class<? extends Script> getCompiledScript(String actionName) {
validateNotEmpty(actionName, "Script ID");
Expand Down
9 changes: 7 additions & 2 deletions extensions/web-tracker/wab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@
"apache-unomi-tracker": "^1.1.0"
},
"devDependencies": {
"@babel/core": "^7.19.1",
"@babel/preset-env": "^7.19.1",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"rollup": "^2.79.0",
"rollup-plugin-polyfill-node": "^0.10.2",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-terser": "^7.0.2"
},
"resolutions": {
"decode-uri-component": "0.2.2",
"json5": "2.2.3",
"semver": "6.3.1"
}
}
1 change: 0 additions & 1 deletion extensions/web-tracker/wab/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<executions>
<execution>
<id>npm install node and yarn</id>
Expand Down
Loading
Loading