Skip to content

Commit

Permalink
Ignore xvfb started with -auth argument
Browse files Browse the repository at this point in the history
This is a hacky way to fix the problem with multiple xvfb running at once consuming all the memory on the agent.

Exact life cycle of the xvfb is unclear to me, but now we may have the situation when we started the first xvfb server, then someone else did the same, so now we have 2 of them. In particular case I'm trying to fix we had:
```
Xvfb :88 -ac -screen 0 1920x1080x24 -nolisten tcp -auth /mnt/agent/temp/buildTmp/xvfb-run.W3R7bl/Xauthority
/usr/bin/Xvfb :10 -ac -screen 0 1920x1080x24 -nolisten tcp -wr
```
The `:10` was our from the previous test, and origin of the `:88` one is unclear.
But, our logic in `com.intellij.ide.starter.driver.engine.remoteDev.XorgWindowManagerHandler.provideDisplay` can handle only one running display for some reason.

Therefore, we started to spawn new servers with 2 hours timeout (`com.intellij.ide.starter.driver.engine.remoteDev.XorgWindowManagerHandler.runXvfb`) and never stopped them.

I'm not sure about proper solution here. I see two ways:
- run and stop xvfb for each client run. But this may be excessive and resource consuming
- mark the process with `-displayID JetDisplayOrSmth` and use only those. Again - do not limit with 1 display, just take first if there are any. And stop all running marked `xvfb` instances in the end of the testing.

GitOrigin-RevId: 72b66092b6e78ca0510e4814f6b896592791e8e7
  • Loading branch information
hurricup authored and intellij-monorepo-bot committed Jun 27, 2024
1 parent c341e23 commit 8e1457b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.intellij.tools.ide.util.common.logOutput
fun getRunningDisplays(): List<Int> {
logOutput("Looking for running displays")
val found = getProcessList()
.filter { it.command.contains("Xvfb") }.map {
.filter { it.command.contains("Xvfb") && !it.command.contains("-auth") }.map {
logOutput(it.command)
it.command.split(" ")
.single { arg -> arg.startsWith(":") }
Expand Down

0 comments on commit 8e1457b

Please sign in to comment.