Skip to content

Commit

Permalink
Merge pull request #79 from bmwcarit/release/27.0.239
Browse files Browse the repository at this point in the history
Release/27.0.129
  • Loading branch information
violinyanev authored Jan 16, 2023
2 parents e190146 + af7b281 commit fc856fb
Show file tree
Hide file tree
Showing 23 changed files with 344 additions and 39 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-Dramses-sdk_CPACK_GENERATOR=DEB \
-Dramses-sdk_BUILD_TESTS=OFF \
-Dramses-sdk_BUILD_EXAMPLES=OFF \
-Dramses-sdk_BUILD_SMOKE_TESTS=OFF \
Expand All @@ -41,7 +42,7 @@ jobs:
-Dramses-sdk_ENABLE_WAYLAND_IVI=OFF
cmake --build . --target package --config $BUILD_TYPE
find . -name '*tar.gz' -exec bash -c 'mv $0 ramses-linux.tar.gz' {} \;
find . -name '*deb' -exec bash -c 'mv $0 ramses-linux-x64.deb' {} \;
if: ${{ matrix.os == 'ubuntu-20.04' }}

- name: Build and package (Windows)
Expand All @@ -58,8 +59,8 @@ jobs:
echo "Path after: $PATH"
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-Dramses_CPACK_GENERATOR=ZIP \
-DCMAKE_CONFIGURATION_TYPES=$BUILD_TYPE \
-Dramses-sdk_CPACK_GENERATOR=ZIP \
-Dramses-sdk_BUILD_TESTS=OFF \
-Dramses-sdk_BUILD_EXAMPLES=OFF \
-Dramses-sdk_BUILD_SMOKE_TESTS=OFF \
Expand All @@ -69,21 +70,21 @@ jobs:
cmake --build . --target package --config $BUILD_TYPE
find . -name '*tar.gz' -exec bash -c 'mv $0 ramses-windows.tar.gz' {} \;
find . -name '*zip' -exec bash -c 'mv $0 ramses-windows-x64.zip' {} \;
if: ${{ matrix.os == 'windows-2019' }}

- name: Publish release
uses: softprops/[email protected]
with:
fail_on_unmatched_files: true
files: |
${{runner.workspace}}/build/ramses-windows.tar.gz
${{runner.workspace}}/build/ramses-windows-x64.zip
if: ${{ matrix.os == 'windows-2019' }}

- name: Publish release
uses: softprops/[email protected]
with:
fail_on_unmatched_files: true
files: |
${{runner.workspace}}/build/ramses-linux.tar.gz
${{runner.workspace}}/build/ramses-linux-x64.deb
if: ${{ matrix.os == 'ubuntu-20.04' }}
15 changes: 13 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
27.0.129
-------------------
API changes
------------------------------------------------------------------------
- Added ramses::DisplayConfig::setResourceUploadBatchSize()

Bugfixes
------------------------------------------------------------------------
- Fix Wayland Dcsm content not getting ready because DcsmProvider was not
sending contentDescription for every ready request
- Fixed SomeIP connection recovery if the initial ParticipantInfo packets
are dropped on network level.

27.0.128
-------------------
General changes
Expand All @@ -9,8 +22,6 @@
- fixed resource hash name formatting (use same format as in the logs)
- added option to sort by uncompressed size
- export shader sources to file or clipboard
- ramses-packet-player:
- added details for scene actions
- Added ramses::DisplayConfig::setScenePriority()

27.0.127
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10)

SET(RAMSES_VERSION_MAJOR 27)
SET(RAMSES_VERSION_MINOR 0)
SET(RAMSES_VERSION_PATCH 128)
SET(RAMSES_VERSION_PATCH 129)
SET(RAMSES_VERSION_POSTFIX "")

CMAKE_POLICY(SET CMP0048 NEW)
Expand Down Expand Up @@ -85,6 +85,8 @@ set(ramses-sdk_FOLDER_PREFIX "" CACHE STRING "Set a custom prefix for target fol

set(ramses-sdk_USE_LINKER_OVERWRITE "" CACHE STRING "Specify used linker (gcc/clang only)")

set(ramses-sdk_CPACK_GENERATOR "TGZ" CACHE STRING "CPack package type (default: TGZ)")

SET(RAMSES_VERSION "${RAMSES_VERSION_MAJOR}.${RAMSES_VERSION_MINOR}.${RAMSES_VERSION_PATCH}${RAMSES_VERSION_POSTFIX}")
set(ramses-sdk_VERSION "${RAMSES_VERSION_MAJOR}.${RAMSES_VERSION_MINOR}.${RAMSES_VERSION_PATCH}" CACHE STRING "Ramses version" FORCE)

Expand Down
1 change: 1 addition & 0 deletions doc/developer/images/initiator_with_old.dot
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ digraph Initiator {
old_code ->unknown [label="Down\n+Inform new" color=purple]
old_code -> send_session [label="New pinfo (bad session)\n+Mark reponsible" color=purple]
old_code -> old_code [label="Old pinfo" color=purple]
old_code -> old_code [label="Error (MID==0)\nSend new pinfo" color=red]

// Must send incrementing MID in keepalive otherwise old code might get confused (We do not know remote yet)
// - Must inform new code of session to be able to match correct session replies
Expand Down
18 changes: 13 additions & 5 deletions external/acme2/internal/create_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#
############################################################################

SET(CPACK_GENERATOR "TGZ")
set(CPACK_GENERATOR ${ramses-sdk_CPACK_GENERATOR})

SET(CPACK_SOURCE_GENERATOR "TGZ")

IF (NOT DEFINED GIT_COMMIT_COUNT OR NOT DEFINED GIT_COMMIT_HASH)
Expand All @@ -26,15 +27,22 @@ ENDIF()
SET(SCM_VERSION "${GIT_COMMIT_COUNT}-${GIT_COMMIT_HASH}")

IF("${CPACK_PACKAGE_NAME}" STREQUAL "")
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
ENDIF()

#SET(CPACK_RPM_COMPONENT_INSTALL 1)
#SET(CPACK_ARCHIVE_COMPONENT_INSTALL 1)
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION_STRING}-${SCM_VERSION}")
SET(CPACK_PACKAGE_CONTACT "${PROJECT_CONTACT}")
SET(CPACK_SOURCE_STRIP_FILES TRUE)
SET(CPACK_STRIP_FILES FALSE)
SET(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VENDOR "ramses")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A distributed 3D rendering framework for embedded systems")
set(CPACK_PACKAGE_DESCRIPTION "A packaged version of ramses. Generated using CPack.")

if(ramses-sdk_CPACK_GENERATOR STREQUAL "DEB")
# Enables CPack to add proper dependency info to the package, see docs for more info
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
endif()

# Allows providing custom package suffix, use "-<commitsha>" by default
if(RAMSES_CUSTOM_PACKAGE_SUFFIX)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,37 @@ namespace ramses_internal
template <typename Callbacks>
void ConnectionSystemBase<Callbacks>::handleKeepAlive(const SomeIPMsgHeader& header, uint64_t /*timestampNow*/, bool usingPreviousMessageId)
{
if (m_connSysIR && m_connSysIR->handleKeepAlive(header, usingPreviousMessageId))
return;
if (m_connSysIR)
{
if (m_connSysIR->handleKeepAlive(header, usingPreviousMessageId))
{
return;
}
else if (header.messageId == 0)
{
// (header.messageId == 0) indicates an error message (response to an unexpected keepalive)
// see ConnectionSystemInitiatorResponder::responderSendErrorForInvalidSid()
// only reset the current session (ignore unknown sessions) to avoid reconnection loops
auto it = std::find_if(m_participantStates.begin(), m_participantStates.end(), [&](auto& up) { return up->sendSessionId == header.sessionId; });
if (it != m_participantStates.end())
{
const auto iid = (*it)->iid;
ParticipantState** maybePstate = m_availableInstances.get(iid);
if (m_connSysIR->isInitiatorAndInvalid(iid) && maybePstate)
{
// resend participantInfo due to lost session response
LOG_WARN_P(m_logContext, "ConnectionSystemBase({}:{})::handleKeepAlive: reset session for iid:{} and send pinfo",
m_communicationUserID, m_serviceTypeName, iid);
auto* pstate = *maybePstate;
initNewSession(*pstate);
trySendParticipantInfo(*pstate);
return;
}
}
// a legacy remote participant (i.e. not a Responder) will not send error messages
// legacy keep-alive handling will be continued instead (see below)
}
}

ParticipantState* pstate = processMessageHeaderGeneric(header, "handleKeepAlive");
if (!pstate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace ramses_internal
uint64_t lastSentSessionId, uint64_t lastSentMessageId,
std::chrono::steady_clock::time_point lastSentTime);
bool handleKeepAlive(const SomeIPMsgHeader& header, bool usingPreviousMessageId);

bool isInitiatorAndInvalid(InstanceIdType iid) const;

// for sending
bool isResponsibleForParticipant(const Guid& pid) const;
Expand Down Expand Up @@ -673,6 +673,19 @@ namespace ramses_internal
return true;
}

template <typename InstanceIdType>
bool ConnectionSystemInitiatorResponder<InstanceIdType>::isInitiatorAndInvalid(InstanceIdType iid) const
{
auto it = m_availableInstances.find(iid);
if (it != m_availableInstances.end())
{
ParticipantState* pstate = it->second;
assert(pstate);
return (pstate->selfIsInitiator && pstate->initiatorState == InitiatorState::Invalid);
}
return false;
}

template <typename InstanceIdType>
bool ConnectionSystemInitiatorResponder<InstanceIdType>::handleKeepAlive(const SomeIPMsgHeader& header, bool usingPreviousMessageId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,77 @@ namespace ramses_internal
}
};

/**
* Verifies responder behaviour if initial pinfo is lost
*/
TEST_F(AConnectionSystemTimeMockConnected, recoverDroppedPinfoResponder)
{
const auto remote_iid_initiator = TestInstanceId(7);
EXPECT_CALL(*this, steadyClockNow()).WillRepeatedly(Return(Tp(1)));
// sending pinfo response to initiator fails
EXPECT_CALL(stack, sendParticipantInfo(remote_iid_initiator, ValidHdr(pid, 1u), 99, sentMinorProtocol, iid, 0, _, _)).WillOnce(Return(false));
fromStack.handleServiceAvailable(remote_iid_initiator);

EXPECT_CALL(stack, sendParticipantInfo(remote_iid_initiator, ValidHdr(pid, 1u), 99, sentMinorProtocol, iid, 1, _, _)).WillOnce(Return(false));
fromStack.handleParticipantInfo(SomeIPMsgHeader{1, 1123, 1}, 99, sentMinorProtocol, remote_iid_initiator, 0, 0, 0);

doLoop(Ms(2), Ms(3), Tp(1));
doLoop(Ms(2), Ms(3), Tp(2));
doLoop(Ms(2), Ms(3), Tp(3));
doLoop(Ms(2), Ms(3), Tp(4));
doLoop(Ms(2), Ms(3), Tp(5));

// sends an error for received keepalives from initiator (due to missing session response)
EXPECT_CALL(stack, sendKeepAlive(remote_iid_initiator, ValidHdr(pid, 0u), 0, true)).WillOnce(Return(true)); // mid:0 indicates error
fromStack.handleKeepAlive(SomeIPMsgHeader{1, 1123, 2}, 0, false);
}

/**
* Verifies initiator recovery if initial pinfo is lost
*/
TEST_F(AConnectionSystemTimeMockConnected, recoverDroppedPinfoInitiator)
{
uint64_t session1 = 0;
const auto remote_iid_responder = TestInstanceId(1);
EXPECT_CALL(*this, steadyClockNow()).WillRepeatedly(Return(Tp(1)));
EXPECT_CALL(stack, sendParticipantInfo(remote_iid_responder, ValidHdr(pid, 1u), 99, sentMinorProtocol, iid, 0, _, _)).WillOnce(StoreSessionAndReturn(&session1, true));
fromStack.handleServiceAvailable(remote_iid_responder);

doLoop(Ms(2), Ms(3), Tp(1));
doLoop(Ms(2), Ms(3), Tp(2));

EXPECT_CALL(stack, sendKeepAlive(remote_iid_responder, ValidHdr(pid, 2u), 0, false)).WillOnce(Return(true)); // regular keepalive
doLoop(Ms(2), Ms(3), Tp(3));
doLoop(Ms(2), Ms(3), Tp(4));

EXPECT_CALL(stack, sendKeepAlive(remote_iid_responder, ValidHdr(pid, 3u), 0, false)).WillOnce(Return(true)); // regular keepalive
doLoop(Ms(2), Ms(3), Tp(5));

// expect new session if an error message (msgid==0) for session1 is received
uint64_t session2 = 0;
EXPECT_CALL(stack, sendParticipantInfo(remote_iid_responder, ValidHdr(pid, 1u), 99, sentMinorProtocol, iid, 0, _, _)).WillOnce(StoreSessionAndReturn(&session2, true));
fromStack.handleKeepAlive(SomeIPMsgHeader{1, session1, 0}, 0, false); // receive error for keepalive
fromStack.handleKeepAlive(SomeIPMsgHeader{1, session1, 0}, 0, false); // receive error for keepalive -> ignore old session id
EXPECT_NE(session1, session2);

doLoop(Ms(2), Ms(3), Tp(6));

EXPECT_CALL(stack, sendKeepAlive(remote_iid_responder, ValidHdr(pid, 2u), 0, false)).WillOnce(Return(true)); // regular keepalive
doLoop(Ms(2), Ms(3), Tp(7));

// again - expect new session if an error message (msgid==0) for session2 is received
uint64_t session3 = 0;
EXPECT_CALL(stack, sendParticipantInfo(remote_iid_responder, ValidHdr(pid, 1u), 99, sentMinorProtocol, iid, 0, _, _)).WillOnce(StoreSessionAndReturn(&session3, true));
fromStack.handleKeepAlive(SomeIPMsgHeader{1, session2, 0}, 0, false); // again receive error for keepalive (session2)
EXPECT_NE(session2, session3);

// finally get a session reply for session3
EXPECT_CALL(connsys->connections, newParticipantHasConnected(Guid(1)));
fromStack.handleParticipantInfo(SomeIPMsgHeader{1, session3, 1}, 99, sentMinorProtocol, remote_iid_responder, 4, 0, 0);

expectRemoteDisconnects({1});
}

TEST_F(AConnectionSystemTimeMockConnected, repeatedlyTriesPinfoWithBackoffWhenFails)
{
EXPECT_CALL(*this, steadyClockNow()).WillRepeatedly(Return(Tp(1)));
Expand Down
10 changes: 6 additions & 4 deletions framework/ramses-framework/include/DcsmProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ namespace ramses
private:
struct DcsmProviderMapContent
{
Category category = Category(0);
ramses_internal::EDcsmState status = ramses_internal::EDcsmState::Offered;
bool ready = false;
bool contentRequested = false;
Category category;
ramses_internal::ETechnicalContentType type;
ramses_internal::TechnicalContentDescriptor contentDescriptor;
ramses_internal::EDcsmState status = ramses_internal::EDcsmState::Offered;
bool ready = false;
bool contentRequested = false;
};

status_t commonOfferContent(const char* callerMethod, ContentID contentID, Category category, ramses_internal::ETechnicalContentType contentType,
Expand Down
25 changes: 20 additions & 5 deletions framework/ramses-framework/src/DcsmProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ namespace ramses
if (contentIt != m_contents.end() && contentIt->second.status != ramses_internal::EDcsmState::AcceptStopOffer)
return addErrorEntry((ramses_internal::StringOutputStream() << "DcsmProvider::" << callerMethod << " failed, ContentID is already registered.").c_str());

m_contents[contentID] = {category};
m_contents[contentID] = { category, contentType, contentDescriptor };
if (!m_dcsm.sendOfferContent(ramses_internal::ContentID(contentID.getValue()), ramses_internal::Category(category.getValue()), contentType, "", mode == EDcsmOfferingMode::LocalOnly))
return addErrorEntry((ramses_internal::StringOutputStream() << "DcsmProvider::" << callerMethod << " failed, failure to send sendOfferContent message.").c_str());
else if (contentType == ramses_internal::ETechnicalContentType::WaylandIviSurfaceID) // skip content description sending for wayland contents
return StatusOK;
else if (!m_dcsm.sendContentDescription(ramses_internal::ContentID(contentID.getValue()), contentDescriptor))
{
m_dcsm.sendRequestStopOfferContent(ramses_internal::ContentID(contentID.getValue()));
Expand Down Expand Up @@ -258,12 +260,25 @@ namespace ramses

if (content.status == ramses_internal::EDcsmState::Shown)
m_handler->contentHide(contentID, anim);
else if (!content.ready)
m_handler->contentReadyRequested(contentID);
else
{
if (!m_dcsm.sendContentReady(ramses_internal::ContentID(contentID.getValue())))
LOG_ERROR(ramses_internal::CONTEXT_DCSM, "DcsmProvider::contentStateChange: failed, failure to send sendContentAvailable message.");
if (content.type == ramses_internal::ETechnicalContentType::WaylandIviSurfaceID)
{
if (!m_dcsm.sendContentDescription(ramses_internal::ContentID(contentID.getValue()), content.contentDescriptor))
{
LOG_ERROR(ramses_internal::CONTEXT_DCSM, "DcsmProvider::contentStateChange: failed, failure to send sendContentDescription message.");
break;
}
}
if (!content.ready)
{
m_handler->contentReadyRequested(contentID);
}
else
{
if (!m_dcsm.sendContentReady(ramses_internal::ContentID(contentID.getValue())))
LOG_ERROR(ramses_internal::CONTEXT_DCSM, "DcsmProvider::contentStateChange: failed, failure to send sendContentAvailable message.");
}
}
break;

Expand Down
Loading

0 comments on commit fc856fb

Please sign in to comment.