Skip to content

Conversation

@OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Oct 25, 2025

Ensures that the reported current thread count and busy thread count is exactly the number of threads reported by the pool. Even if monitoring is started while thread pool is actively processing requests.

A few improvements in Embedded GlassFish to enable monitoring and access it via JMX (it was completely broken before):

  • if the flashlight-agent is already loaded, don't attempt to load it - that would fail on newer Java versions
  • concatenate probe-provider-class-names MANIFEST elements from dependencies, using gmaven plugin script at build time. It references all probes that should be activated

Embedded GlassFish requires running with flashlight-agent on command line with -javaagent:flashlight-agent.jar on newer Java versions as it doesn't contain the agent. Dynamic loading of agent is not a good practice with newer Java versions anyway.

When started with command "enable-monitoring --mbean true", metric will be available via JMX beans:

Example to start Embedded GlassFish with thread pool and http service metrics:

java -javaagent:/path/to/flashlight-agent.jar -jar glassfish-embedded-all.jar 'enable-monitoring --modules thread-pool:http-service'

Or, alternatively, using the following properties in glassfish.properties in the current directory:

configs.config.server-config.monitoring-service.module-monitoring-levels.thread-pool=HIGH
configs.config.server-config.monitoring-service.module-monitoring-levels.http-service=HIGH

And command:

java -javaagent:/path/to/flashlight-agent.jar -jar glassfish-embedded-all.jar

Then in VisualVM (with MBeans extension), in the amx node:

image

If you don't see the amx node, you need to execute the bootAMX operation from VisualVM first (the added test demonstrates how to do that in code):

image

@OndroMih OndroMih force-pushed the ondromih-glassfish7-monitoring branch 6 times, most recently from 28dd44c to 0a14238 Compare October 26, 2025 13:54
@OndroMih OndroMih added embedded Relates to the Embedded GlassFish Component: Monitoring Related to GlassFish monitoring, metrics, etc. labels Oct 28, 2025
@OndroMih OndroMih requested a review from a team October 29, 2025 09:15
@OndroMih OndroMih force-pushed the ondromih-glassfish7-monitoring branch 2 times, most recently from 4575b83 to dc4c6e7 Compare October 30, 2025 00:00
@OndroMih OndroMih requested a review from dmatej October 30, 2025 19:51
@OndroMih OndroMih force-pushed the ondromih-glassfish7-monitoring branch 3 times, most recently from 307b54a to f8b7383 Compare November 2, 2025 09:57
@OndroMih OndroMih force-pushed the ondromih-glassfish7-monitoring branch 8 times, most recently from 143f041 to cdcbcdc Compare November 3, 2025 01:28
OndroMih and others added 7 commits November 4, 2025 20:46
…eted

Print an exception at the end rather than for each file separately
Use only for temp dir. If used for workspace, we run out of space.
Drive D is already used for workspace.

See why D and RAM disks should be used:
https://www.chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you#windows-dev-drive--virtual-hard-disk-vhdx
It gets stuck for some reason and then the job is killed after 6 hours.
- Special matcher
- Deleting temporary files
- Removed LONG_RUNNING tag from monitorngtest - finishes around 2 seconds.
  Instead I tried to stabilize the host resolution which seems to make problems
  on windows (looks like JDK bug?)


Signed-off-by: David Matějček <[email protected]>
@dmatej dmatej force-pushed the ondromih-glassfish7-monitoring branch from 297161f to 07c0830 Compare November 4, 2025 23:01
on:
pull_request:
branches: [ "master", "7.0", "8.0" ]
permissions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required, unlike in other workflows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First idea was that the windows container is so slow, so Ondro tried to find some solution to improve its performance using ram disks etc. Now I am slowly fixing some problematic code pieces and adding logs to find out why the execution just times out after several hours and just with Windows GHA container.
I will try to run that yet on Windws Server 25 in VirtualBox for sure, because this is really awful behavior, looks like some black hole network communication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is for

permissions:
  checks: write

I've seen commit with that setting being removed (undone) from other workflow files, but it's still in linux one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @dmatej you reverted too much in this commit: 3fb9a43

I added

permissions:
  checks: write

for the action-junit-report step, although I added it with a commit that only mentions adding RAM disk. Though it seems that have this permission block doesn't have any effect.

I don't understand how the action-junit-report exactly works. Now I tried to enable annotation-only mode, hopefully it will provide us what I seek for - information about which tests fail if some tests fail. Right now, this step only provides the number of passed and failed tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a work in progress, I will go over those commits later one by one and move some changes to own PR. First I need to understand what is really happening and why the build freezes just on GHA.

@dmatej dmatej force-pushed the ondromih-glassfish7-monitoring branch from ee88819 to 3b12636 Compare November 5, 2025 19:27
@dmatej dmatej self-assigned this Nov 5, 2025
@dmatej dmatej force-pushed the ondromih-glassfish7-monitoring branch from 0382c18 to 3a940a2 Compare November 5, 2025 21:28
Not to change the action status as we don't need it and it requires elevated permissions.

Enable more info for the test report, not just summary
@dmatej dmatej force-pushed the ondromih-glassfish7-monitoring branch from 3a940a2 to 05060d9 Compare November 5, 2025 21:34
@OndroMih OndroMih force-pushed the ondromih-glassfish7-monitoring branch 2 times, most recently from 2357ee7 to 4dcd2d6 Compare November 5, 2025 21:46
- Partially removed printing stacktraces when we throw after that
- AMXConfigLoader - refactoring
  - condition was always true, and we could move some code to constructor
    to make it more visible
  - synchronization was not useful here, the code is synchronized
    from the outside too
- Formatting, blank lines, annotations
- Throwing "unreachable" exceptions instead of swallowing them

Signed-off-by: David Matějček <[email protected]>
@dmatej dmatej marked this pull request as draft November 7, 2025 22:39
@dmatej
Copy link
Contributor

dmatej commented Nov 7, 2025

Status: I have rebased #25768 to this, fixed conflicts (I made them). Now I will create another PR just with Ondro's changes in GHA, then I will rebase again, I will try yet to improve the performance of those new tests in application-tests, so we could avoid those tags. I have a new weapon for that, learned new usages of the Stream API :-)

Otherwise, nothing new about Jenkins performance, unfortunately.

@dmatej dmatej added this to the 7.1.0 milestone Nov 8, 2025
@dmatej dmatej added bug Something isn't working enhancement New feature or request labels Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Component: Monitoring Related to GlassFish monitoring, metrics, etc. embedded Relates to the Embedded GlassFish enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants