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

Add option to limit number of parallel debug connections #353

Closed
iandunn opened this issue Jun 20, 2023 · 6 comments
Closed

Add option to limit number of parallel debug connections #353

iandunn opened this issue Jun 20, 2023 · 6 comments
Labels
feature New feature or request

Comments

@iandunn
Copy link

iandunn commented Jun 20, 2023

When I'm debugging I often have multiple browser tabs open for the site, to test various aspects of it. Those pages often have "heartbeat" XHR requests that run automatically every ~30 seconds. Every time a new request comes in, the Run and Debug panel switches to it, and I have to stop the new request, then go back to my original one. That makes debugging very frustrating.

I think it'd be useful to have an option to limit the number of parallel requests, similar to the maxConnections option in the Xdebug extension.


Note: I've tried adding the endpoint filename to the exclude param, but that doesn't do what I want. I want to completely ignore any requests to a specific URL/file, rather than processing the request but bypass the file when stepping through the code.

As a workaround, I've tried enabling both extensions, but this one always seems to process the request, and I haven't found a way to make the Xdebug one "win" the conflict.

@jakubmisek
Copy link
Member

Thank you for the suggestions. The maxConnections option might help.

Although (but we don't have the setting for it yet) Xdebug itself has a few settings to control connections more accurately.

Would it help if you could debug only requests with a specific GET parameter? We would take advantage of Xdebug's trigger_value setting, so Xdebug would initiate connection only if there is a specified ?XDEBUG_TRIGGER=... query parameter. Any other request would not even initiate the connection back to VSCode.

@jakubmisek jakubmisek added the feature New feature or request label Jun 20, 2023
@jakubmisek
Copy link
Member

@iandunn pre-release 1.35.13329 adds "trigger" launch setting which allows to debug only requests with XDEBUG_TRIGGER GET parameter, i.e.

        {
            "name": "Debug built-in server",
            "type": "php",
            "request": "launch",
            "runtimeArgs": ["-S", "localhost:8000"],
            "trigger": "Start",
        },

so only localhost?XDEBUG_TRIGGER=Start will initiate debugging.

@iandunn
Copy link
Author

iandunn commented Jun 21, 2023

🤔 That could help, but it could also be inconvenient to add it manually whenever I want to debug. I'll look into Xdebug's native settings, though, I hadn't thought of that 👍🏻

@iandunn
Copy link
Author

iandunn commented Jun 21, 2023

I checked the settings but didn't see anything related to limiting the # of simultaneous connections. Which one were you thinking of?

@Miloslav
Copy link
Member

Hello,

Sorry it took a while, the next preview version will include the settings.

Thanks for the suggestions!

@iandunn
Copy link
Author

iandunn commented Jan 13, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants