Skip to content

Commit

Permalink
Configure Undefined Behaviour Sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Jul 29, 2022
1 parent 173fcd6 commit b9bd3b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
CXXCOMPILER: g++-9
ENABLE_SANITIZER: ON
TARGET_ARCH: x86_64-asan-ubsan
OSRM_CONNECTION_RETRIES: 30

- name: clang-5.0-debug
continue-on-error: false
Expand Down
4 changes: 2 additions & 2 deletions features/lib/osrm_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class OSRMBaseLoader{
var retryCount = 0;
let retry = (err) => {
if (err) {
if (retryCount < 10) {
if (retryCount < this.scope.OSRM_CONNECTION_RETRIES) {
retryCount++;
setTimeout(() => { tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry); }, 10);
} else {
callback(new Error("Could not connect to osrm-routed after ten retries."));
callback(new Error(`Could not connect to osrm-routed after ${this.scope.OSRM_CONNECTION_RETRIES} retries.`));
}
}
else
Expand Down
1 change: 1 addition & 0 deletions features/support/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = function () {

this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
this.OSRM_CONNECTION_RETRIES = process.env.OSRM_CONNECTION_RETRIES || 10;
this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;

this.OSRM_PROFILE = process.env.OSRM_PROFILE;
Expand Down

0 comments on commit b9bd3b6

Please sign in to comment.