Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't apply empty settings from not initialized TracingBlock #1622

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

iloveeclipse
Copy link
Member

Fixes #1621

@iloveeclipse
Copy link
Member Author

@HeikoKlare, @fedejeanne, @HannesWell : could you please check this PR and #1621?
For me it seem to fix the scenario I described in #1621.
However after so many fixes / reverts in this area the fix here seem to be too simple, so there must be a catch?
Do I miss something?

@iloveeclipse
Copy link
Member Author

PS: my goal is to have some fix in 4.35 RC1 for #1621, whether it is this PR or revert of something again, or something completely different.

Copy link

Test Results

   285 files  ±0     285 suites  ±0   50m 51s ⏱️ + 5m 18s
 3 608 tests ±0   3 532 ✅ ±0   76 💤 ±0  0 ❌ ±0 
11 016 runs  ±0  10 785 ✅ ±0  231 💤 ±0  0 ❌ ±0 

Results for commit 60646cd. ± Comparison against base commit 79d7e75.

@iloveeclipse iloveeclipse added this to the 4.35 RC1 milestone Feb 18, 2025
@HannesWell
Copy link
Member

After a very quick look this change seems sound.
But I'll have a detailed review later this evening and will submit it, if it's fine and save.

Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After an in detail review this still looks save and the right thing to do.

@HannesWell HannesWell added the pmc_approved Issues with PMC approval label Feb 18, 2025
@HannesWell HannesWell merged commit 515f996 into eclipse-pde:master Feb 18, 2025
17 of 18 checks passed
@iloveeclipse iloveeclipse deleted the issue_1621 branch February 19, 2025 05:04
@fedejeanne
Copy link
Contributor

Hi, sorry for the late reply, I was out-of-office yesterday.

@iloveeclipse thank you for the fix. I actually run into a similar issue with the PluginsTab while working on #1252 and introduced a similar solution. The only difference I see with this PR is that you may initialize the tracing block with the same input when you switch back and forth between the tracing tab and other tabs. I avoided this to improve performance in https://github.com/eclipse-pde/eclipse.pde/pull/1252/files#diff-508c84ed339b4ddeadd5db68b30fc9a66cfd8db2c9ebd080678483782bbfaab7

image

Maybe that's also worth doing in your case?

@iloveeclipse
Copy link
Member Author

The only difference I see with this PR is that you may initialize the tracing block with the same input when you switch back and forth between the tracing tab and other tabs. I avoided this to improve performance in https://github.com/eclipse-pde/eclipse.pde/pull/1252/files#diff-508c84ed339b4ddeadd5db68b30fc9a66cfd8db2c9ebd080678483782bbfaab7

Maybe that's also worth doing in your case?

Thanks for the hint.

I honestly have no time digging into performance optimization in this particular area, as I never observed any performance problems here nor anyone reported that for our product. If you know what to do, please provide a PR.

@HannesWell
Copy link
Member

The only difference I see with this PR is that you may initialize the tracing block with the same input when you switch back and forth between the tracing tab and other tabs.

Can you explain this in more detail? The initialization of each tab from an existing launch-config should only happen once and at least the change in this PR doesn't change it. I assume you meant this as a general remark or do you think this is not save or wrong?

I honestly have no time digging into performance optimization in this particular area, as I never observed any performance problems here nor anyone reported that for our product. If you know what to do, please provide a PR.

The main pain-point here is that initializing the 'registry' of available tracing options scans all bundles in the TP and depending on it's size this can take some time. But it's only done once per Eclipse execution (which is actually wrong, because changing the TP may change the list of tracable bundles and each bundles options).
Maybe we should only postpone reading the registry and not the UI initialization (e.g. by using some kind of proxies) to avoid this problem in a more elegant way with less state. But all of this is something for #1252 I think. Sorry Federico I know you are awaiting a review and I'll try my best to do it soon.

@fedejeanne
Copy link
Contributor

Can you explain this in more detail? The initialization of each tab from an existing launch-config should only happen once and at least the change in this PR doesn't change it.

That's correct and this PR doesn't change that so it's safe 👍 . The detailed explanation is:

  • The initialization (call to org.eclipse.debug.ui.ILaunchConfigurationTab.initializeFrom(ILaunchConfiguration)) happens only once and it happens right at the beginning, when one selects the run configuration
  • The activation (call to org.eclipse.debug.ui.ILaunchConfigurationTab.activated(ILaunchConfigurationWorkingCopy)) can happen any number of times (0+) and it happens every time the tab is selected

I assume you meant this as a general remark or do you think this is not save or wrong?

It was just a general remark about performance. This PR is safe and I don't see any need to add any changes to it. If performance every becomes a problem, we may add the early return (Zukunftsmusik).

The main pain-point here is that initializing the 'registry' of available tracing options scans all bundles in the TP and depending on it's size this can take some time. But it's only done once per Eclipse execution (which is actually wrong, because changing the TP may change the list of tracable bundles and each bundles options).
Maybe we should only postpone reading the registry and not the UI initialization (e.g. by using some kind of proxies) to avoid this problem in a more elegant way with less state. But all of this is something for #1252 I think. Sorry Federico I know you are awaiting a review and I'll try my best to do it soon.

I'd say we can leave the detailed discussion for #1252 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pmc_approved Issues with PMC approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracing settings disappear after changing launch config
3 participants