-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2025 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License.AGPL.txt in the project root for license information. | ||
|
||
package io.gitpod.jetbrains.remote.optional | ||
|
||
import com.jetbrains.rd.util.lifetime.Lifetime | ||
import com.jetbrains.rd.util.threading.coroutines.launch | ||
import io.gitpod.jetbrains.remote.AbstractGitpodPortForwardingService | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
@Suppress("UnstableApiUsage") | ||
class GitpodRiderPortForwardingService : AbstractGitpodPortForwardingService() { | ||
override fun runJob(lifetime: Lifetime, block: suspend CoroutineScope.() -> Unit) = lifetime.launch { block() } | ||
|
||
override suspend fun <T> applyThrottling(flow: Flow<T>): Flow<T> = flow | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,6 +12,8 @@ function replaceImage(image) { | |||||
const imagesBuildFromMain = [ | ||||||
"jb-backend-plugin:commit-2d67254d5aa110bc2c76cd807b85b272e3d54d97-latest", | ||||||
"jb-backend-plugin:commit-4c69ad0670cc4cfbf43910e1db700ad90acd5ac6", | ||||||
"jb-backend-plugin:commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider", | ||||||
"jb-backend-plugin:commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider-latest", | ||||||
]; | ||||||
|
||||||
// TODO(hw): remove me | ||||||
|
@@ -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 commentThe 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
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
json.ideOptions.options[ide].pluginImage = replaceImage2(json.ideOptions.options[ide].pluginImage); | ||||||
json.ideOptions.options[ide].imageLayers = json.ideOptions.options[ide].imageLayers.map(replaceImage2); | ||||||
} | ||||||
|
||||||
if (["code", "code1_85"].includes(ide)) { | ||||||
json.ideOptions.options[ide].image = replaceImage(json.ideOptions.options[ide].image); | ||||||
json.ideOptions.options[ide].imageLayers = json.ideOptions.options[ide].imageLayers.map(replaceImage); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -75,10 +75,12 @@ func GenerateIDEConfigmap(ctx *common.RenderContext) (*ide_config.IDEConfig, err | |||||||||
CodeHelperImage: ctx.ImageName(ctx.Config.Repository, ide.CodeHelperIDEImage, ctx.VersionManifest.Components.Workspace.CodeHelperImage.Version), | ||||||||||
CodeWebExtensionImage: ctx.ImageName(ctx.Config.Repository, ide.CodeWebExtensionImage, ctx.VersionManifest.Components.Workspace.CodeWebExtensionImage.Version), | ||||||||||
|
||||||||||
JetBrainsPluginImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginImage.Version), | ||||||||||
JetBrainsPluginLatestImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginLatestImage.Version), | ||||||||||
JetBrainsPluginRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginRiderImage.Version), | ||||||||||
JetBrainsPluginLatestRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginLatestRiderImage.Version), | ||||||||||
JetBrainsPluginImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginImage.Version), | ||||||||||
JetBrainsPluginLatestImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginLatestImage.Version), | ||||||||||
|
||||||||||
// Pin Rider's backend-plugin version as we don't plan to upgrade Rider yet | ||||||||||
JetBrainsPluginRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider"), | ||||||||||
JetBrainsPluginLatestRiderImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, "commit-8cdc2a1a45c66ac9e003a97af8c57fad42d923f6-rider-latest"), | ||||||||||
Comment on lines
+82
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||
JetBrainsLauncherImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsLauncherImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsLauncherImage.Version), | ||||||||||
ResolvedJBImageLatest: JBImages{ | ||||||||||
IntelliJ: resolveLatestImage(ide.IntelliJDesktopIDEImage, "latest", ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJLatestImage), | ||||||||||
|
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 suspendemit
until a collector is ready. Consider configuring anextraBufferCapacity
or usingMutableSharedFlow(replay=0, extraBufferCapacity=N)
to avoid potential deadlocks if bursts of events arrive before collection.Copilot uses AI. Check for mistakes.