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

Open debugging port to the core #120

Merged
merged 9 commits into from
Oct 14, 2024
Merged

Conversation

tokland
Copy link
Contributor

@tokland tokland commented Mar 12, 2024

https://app.clickup.com/t/86941z0ab

#86941z0ab

  • Automatically open and expose --debug-port=PORT for debugging with a Java IDE (IDEA, for example)
$ git clone https://github.com/dhis2/dhis2-core
$ git checkout v2.37.10 # version to debug, it should match the WAR version

@9sneha-n
Copy link
Contributor

As discussed with Arnau, I am unable to debug due to an issue specific to MAC M1 machine. I will try to debug further at a later time, but do not want to block the merging of this PR.

@tokland tokland changed the title Open automatically debug port Open debugging port to the core Mar 20, 2024
@anagperal
Copy link

anagperal commented Mar 22, 2024

Tested with data docker.eyeseetea.com/eyeseetea/dhis2-data:2.37.9-sierra and docker.eyeseetea.com/eyeseetea/dhis2-data:2.37.10-test both with options --core-image=docker.eyeseetea.com/eyeseetea/dhis2-core:2.37.10 --debug-port=7080. All the docker part is correct, but when I configure the debugger in IntelliJ I get the following error:
Screenshot from 2024-03-22 13-43-57
Tested in Ubuntu 22.04.3 LTS

@tokland
Copy link
Contributor Author

tokland commented Mar 24, 2024

I see what's happening. Depending on the JDK version, the debug port listens to all or only localhost, that's why it was core-dependent. ea876a0: Now it's forcing a binding to 0.0.0.0 so it should work for any core.

Can you test again? @9sneha-n @anagperal

(No need to regenerate the cores)

@9sneha-n
Copy link
Contributor

9sneha-n commented Mar 25, 2024

I see what's happening. Depending on the JDK version, the debug port listens to all or only localhost, that's why it was core-dependent. ea876a0: Now it's forcing a binding to 0.0.0.0 so it should work for any core.

Can you test again? @9sneha-n @anagperal

@tokland I am still getting the same error :(
Screenshot 2024-03-25 at 1 36 37 PM

@anagperal
Copy link

I see what's happening. Depending on the JDK version, the debug port listens to all or only localhost, that's why it was core-dependent. ea876a0: Now it's forcing a binding to 0.0.0.0 so it should work for any core.

Can you test again? @9sneha-n @anagperal

Hi! For me, it's already working. Thanks!
Screenshot from 2024-03-25 09-38-47

@tokland
Copy link
Contributor Author

tokland commented Mar 25, 2024

For me, it's already working

Cool! So maybe Sneha is still stuck with the Mac-specific problem. We'll check it out, anyway.

@9sneha-n
Copy link
Contributor

For me, it's already working

Cool! So maybe Sneha is still stuck with the Mac-specific problem. We'll check it out, anyway.

The debug port works for me too! thank you @tokland for taking time to figure out the issue :D

@tokland
Copy link
Contributor Author

tokland commented Mar 28, 2024

@eperedo Can you test the current version in Windows?

@eperedo
Copy link

eperedo commented Apr 15, 2024

@tokland Sorry, I didn't have time to test it again. I'll try to do it as soon as possible.

UPDATE: working on windows 10

image

@tokland
Copy link
Contributor Author

tokland commented Aug 29, 2024

  • To avoid exposing random debug port if not specified -> refactor: generate dynamic yaml + use to remove debug-port reference if empty

@adrianq adrianq merged commit 4390b3a into development Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants