RUBY-20358 Added experimental feature for closing WSL process stdin (disabled by default)

IDEA-CR-42215
This commit is contained in:
Alexandr Evstigneev
2019-01-21 15:25:12 +03:00
parent e86cb60cba
commit 562cf4e640
2 changed files with 12 additions and 2 deletions
@@ -10,6 +10,7 @@ import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -122,10 +123,13 @@ public class WSLUtil {
* Temporary hack method to fix <a href="https://github.com/Microsoft/BashOnWindows/issues/2592">WSL bug</a>
* Must be invoked just before execution, see RUBY-20358
*/
@ApiStatus.ScheduledForRemoval(inVersion = "2019.2")
@NotNull
public static <T extends ProcessHandler> T addInputCloseListener(@NotNull T processHandler) {
processHandler.removeProcessListener(INPUT_CLOSE_LISTENER);
processHandler.addProcessListener(INPUT_CLOSE_LISTENER);
if (Experiments.isFeatureEnabled("wsl.close.process.input")) {
processHandler.removeProcessListener(INPUT_CLOSE_LISTENER);
processHandler.addProcessListener(INPUT_CLOSE_LISTENER);
}
return processHandler;
}
@@ -13,6 +13,12 @@
<appStarter implementation="com.intellij.ide.plugins.BundledPluginsLister"/>
<applicationService serviceImplementation="com.intellij.execution.wsl.WSLDistributionService"/>
<experimentalFeature id="wsl.close.process.input" percentOfUsers="0">
<description>Forces closing of WSL process input stream to prevent process zombification. See
https://github.com/Microsoft/WSL/issues/2592
Required for Windows 10 version prior 1803
</description>
</experimentalFeature>
<applicationService serviceInterface="com.intellij.openapi.components.impl.stores.IComponentStore"
serviceImplementation="com.intellij.configurationStore.ApplicationStoreImpl"/>