Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 29, 2025

🦟 Bug fix

Related issue: gazebosim/jetty_demo#3

Summary

While testing the Jetty demo world, it was found that Gazebo took a while to load because there is a large number of entities in the world. The slow down is mainly on the GUI side. One cause of the long load time was found to be that the GuiRunner setting its ECM initial state twice: Once from the async state request and the other from the state topic subscription callback (sync version).

More info:

There was a PR (#1073) to only start the processing the states from topic subscription callback (sync version) only after the async version is done, which is tracked using the this->dataPtr->receivedInitialState bool variable. That worked fine until this merge forward change that changed the processing of the state request in the aysnc callback to a QueuedConnection. As the result, the state is not processed immediately but this->dataPtr->receivedInitialState is incorrectly marked as true. This causes the sync version to start processing states right away.

The fix is to properly set this->dataPtr->receivedInitialState to true in the state callback function after the states are actually processed.

This patch reduces the load time by ~15 seconds (from ~1min 10sec to ~55 sec) on my machine.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.


This is an automatic backport of pull request #3044 done by [Mergify](https://mergify.com).

Copy link
Contributor Author

mergify bot commented Aug 29, 2025

Cherry-pick of 6529f3f has failed:

On branch mergify/bp/gz-sim9/pr-3044
Your branch is up to date with 'origin/gz-sim9'.

You are currently cherry-picking commit 6529f3f7.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/gui/GuiRunner.cc

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Aug 29, 2025
@mergify mergify bot requested a review from jennuine as a code owner August 29, 2025 21:17
@mergify mergify bot added the conflicts label Aug 29, 2025
@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Aug 29, 2025
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit 6529f3f)
Signed-off-by: Ian Chen <ichen@openrobotics.org>

# Conflicts:
#	src/gui/GuiRunner.cc
@iche033 iche033 force-pushed the mergify/bp/gz-sim9/pr-3044 branch from 67726f6 to a80d7ba Compare August 30, 2025 00:15
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Sep 1, 2025
@ahcorde ahcorde enabled auto-merge (squash) September 1, 2025 08:11
@ahcorde ahcorde requested a review from iche033 September 1, 2025 08:11
@iche033 iche033 disabled auto-merge September 3, 2025 00:20
@iche033 iche033 merged commit 2a507d2 into gz-sim9 Sep 3, 2025
13 of 14 checks passed
@iche033 iche033 deleted the mergify/bp/gz-sim9/pr-3044 branch September 3, 2025 00:20
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants