Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
434a3a638a | ||
|
6305f4a529 | ||
|
646b1631ab | ||
|
a852ab1c43 | ||
|
ff25fc70f0 | ||
|
b34ed587d0 | ||
|
b58329104a | ||
|
d188e8e2a8 |
@ -13,6 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- 5.5
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
|
@ -1,3 +1,12 @@
|
||||
# 5.5.2
|
||||
- Changes from 5.5.1
|
||||
- Revert smarter map-matching search radius. The increased radius causes performance degredation when map-matching against non-car road networks with more edges.
|
||||
|
||||
# 5.5.1
|
||||
- Changes from 5.5.0
|
||||
- Bugfixes
|
||||
- Fixes #3455 where a deadlock could occur if re-loading new data under heavy load with multiple consumers osrm-datastore
|
||||
|
||||
# 5.5.0
|
||||
- Changes from 5.4.0
|
||||
- API:
|
||||
|
@ -53,7 +53,7 @@ endif()
|
||||
project(OSRM C CXX)
|
||||
set(OSRM_VERSION_MAJOR 5)
|
||||
set(OSRM_VERSION_MINOR 5)
|
||||
set(OSRM_VERSION_PATCH 0)
|
||||
set(OSRM_VERSION_PATCH 2)
|
||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
|
||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
@ -38,29 +38,33 @@ class SharedMemoryDataFacade : public ContiguousInternalMemoryDataFacadeBase
|
||||
// used anymore. We crash hard here if something goes wrong (noexcept).
|
||||
virtual ~SharedMemoryDataFacade() noexcept
|
||||
{
|
||||
// Now check if this is still the newest dataset
|
||||
boost::interprocess::sharable_lock<boost::interprocess::named_upgradable_mutex>
|
||||
current_regions_lock(shared_barriers->current_regions_mutex,
|
||||
boost::interprocess::defer_lock);
|
||||
|
||||
boost::interprocess::scoped_lock<boost::interprocess::named_sharable_mutex> exclusive_lock(
|
||||
data_region == storage::DATA_1 ? shared_barriers->regions_1_mutex
|
||||
: shared_barriers->regions_2_mutex,
|
||||
boost::interprocess::defer_lock);
|
||||
|
||||
// if this returns false this is still in use
|
||||
if (exclusive_lock.try_lock())
|
||||
if (current_regions_lock.try_lock() && exclusive_lock.try_lock())
|
||||
{
|
||||
if (storage::SharedMemory::RegionExists(data_region))
|
||||
{
|
||||
BOOST_ASSERT(storage::SharedMemory::RegionExists(layout_region));
|
||||
|
||||
// Now check if this is still the newest dataset
|
||||
const boost::interprocess::sharable_lock<boost::interprocess::named_upgradable_mutex>
|
||||
lock(shared_barriers->current_regions_mutex);
|
||||
|
||||
auto shared_regions = storage::makeSharedMemory(storage::CURRENT_REGIONS);
|
||||
const auto current_timestamp =
|
||||
static_cast<const storage::SharedDataTimestamp *>(shared_regions->Ptr());
|
||||
|
||||
if (current_timestamp->timestamp == shared_timestamp)
|
||||
// check if the memory region referenced by this facade needs cleanup
|
||||
if (current_timestamp->data == data_region)
|
||||
{
|
||||
util::Log(logDEBUG) << "Retaining data with shared timestamp " << shared_timestamp;
|
||||
BOOST_ASSERT(current_timestamp->layout == layout_region);
|
||||
util::Log(logDEBUG) << "Retaining data with shared timestamp "
|
||||
<< shared_timestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -19,14 +19,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
static double search_radius_for_gps_radius(double gps_radius)
|
||||
{
|
||||
// For a given GPS radius, determine the radius we need to search for candidate street segments
|
||||
// to have a 99.9% chance of finding the correct segment.
|
||||
// For more detail, see the analysis at https://github.com/Project-OSRM/osrm-backend/pull/3184
|
||||
return std::min(gps_radius * 3.5 + 45, 200.0);
|
||||
}
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
@ -160,9 +152,16 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
|
||||
std::transform(parameters.radiuses.begin(),
|
||||
parameters.radiuses.end(),
|
||||
search_radiuses.begin(),
|
||||
[&](const boost::optional<double> &maybe_radius) {
|
||||
double gps_radius = maybe_radius ? *maybe_radius : DEFAULT_GPS_PRECISION;
|
||||
return search_radius_for_gps_radius(gps_radius);
|
||||
[](const boost::optional<double> &maybe_radius) {
|
||||
if (maybe_radius)
|
||||
{
|
||||
return *maybe_radius * RADIUS_MULTIPLIER;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user