-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[JetBrains] Improve ports listener leaking #20872
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates how the Rider backend plugin image is pinned, integrates Rider into the preview patch script, refactors the port-forwarding service to use a throttled shared flow, and adjusts plugin XMLs to register the forwarding service per channel.
- Pin Rider’s backend-plugin image to a specific commit in the IDE config map.
- Extend the preview patch script to handle Rider images.
- Refactor
AbstractGitpodPortForwardingService
to useMutableSharedFlow
with throttling and introduce a Rider-specific forwarding service. - Move service registration out of the main
plugin.xml
into channel-specific extensions and update the Gradle stable build to exclude the main impl.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
install/installer/pkg/components/ide-service/ide_config_configmap.go | Hardcode pinned commit for Rider plugin images |
dev/preview/workflow/preview/patch-ide-configmap.js | Add Rider image entries and mapping logic |
components/ide/jetbrains/backend-plugin/src/main/resources/META-INF/plugin.xml | Remove default port-forwarding service registration |
components/ide/jetbrains/backend-plugin/src/main/resources-stable/META-INF/extensions.xml | Register forwarding service for stable channel |
components/ide/jetbrains/backend-plugin/src/main/resources-latest/META-INF/extensions.xml | Register forwarding service for latest channel |
components/ide/jetbrains/backend-plugin/src/main/resources-rider/META-INF/plugin.xml | Register Rider-specific forwarding service |
components/ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/…ServiceImpl.kt | Add throttleLatest to main forwarding service implementation |
components/ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/AbstractGitpodPortForwardingService.kt | Use MutableSharedFlow with throttling |
components/ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/optional/GitpodRiderPortForwardingService.kt | Introduce Rider forwarding service stub |
components/ide/jetbrains/backend-plugin/build.gradle-stable.kts | Exclude main forwarding service impl on stable Rider builds |
Comments suppressed due to low confidence (1)
components/ide/jetbrains/backend-plugin/build.gradle-stable.kts:41
- Excluding
GitpodPortForwardingServiceImpl.kt
in the stable build removes the class referenced inextensions.xml
and will cause a class-not-found error. You likely meant to exclude the Rider-specific implementation, not the main service impl.
sourceSets["main"].kotlin.exclude("**/GitpodPortForwardingServiceImpl.kt")
JetBrainsPluginRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider"), | ||
JetBrainsPluginLatestRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider-latest"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This hardcoded commit string acts as a magic value. Consider extracting it into a named constant or configuration property to make future updates clearer.
JetBrainsPluginRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider"), | |
JetBrainsPluginLatestRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider-latest"), | |
JetBrainsPluginRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, RiderCommit), | |
JetBrainsPluginLatestRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, RiderLatestCommit), |
Copilot uses AI. Check for mistakes.
@@ -43,6 +45,11 @@ for (let ide in json.ideOptions.options) { | |||
json.ideOptions.options[ide].imageLayers = json.ideOptions.options[ide].imageLayers.map(replaceImage2); | |||
} | |||
|
|||
if (["rider"].includes(ide)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using an array for a single value is overkill. You can simplify this to if (ide === "rider")
for clarity.
if (["rider"].includes(ide)) { | |
if (ide === "rider") { |
Copilot uses AI. Check for mistakes.
@@ -34,8 +37,26 @@ abstract class AbstractGitpodPortForwardingService : GitpodPortForwardingService | |||
private val perClientPortForwardingManager = service<PerClientPortForwardingManager>() | |||
private val ignoredPortsForNotificationService = service<GitpodIgnoredPortsForNotificationService>() | |||
private val lifetime = Lifetime.Eternal.createNested() | |||
private val portStatusFlow = MutableSharedFlow<Status.PortsStatusResponse>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default MutableSharedFlow
has no buffer and will suspend emit
until a collector is ready. Consider configuring an extraBufferCapacity
or using MutableSharedFlow(replay=0, extraBufferCapacity=N)
to avoid potential deadlocks if bursts of events arrive before collection.
private val portStatusFlow = MutableSharedFlow<Status.PortsStatusResponse>() | |
private val portStatusFlow = MutableSharedFlow<Status.PortsStatusResponse>(replay = 0, extraBufferCapacity = 64) |
Copilot uses AI. Check for mistakes.
Description
Related Issue(s)
Fixes #
How to test
Integration tests
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold