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

PAYARA-486 - Fixed wrong session count after failover #561

Merged
merged 2 commits into from
Dec 11, 2015
Merged

PAYARA-486 - Fixed wrong session count after failover #561

merged 2 commits into from
Dec 11, 2015

Conversation

MeroRai
Copy link
Member

@MeroRai MeroRai commented Dec 10, 2015

No description provided.

@payara-ci
Copy link
Contributor

Can one of the admins verify this patch?

1 similar comment
@payara-ci
Copy link
Contributor

Can one of the admins verify this patch?

@smillidge
Copy link
Contributor

jenkins test please

@payara-ci
Copy link
Contributor

All tests have passed

smillidge added a commit that referenced this pull request Dec 11, 2015
PAYARA-486 - Fixed wrong session count after failover
@smillidge smillidge merged commit 6f89afc into payara:master Dec 11, 2015
@hdhoang
Copy link
Contributor

hdhoang commented Nov 25, 2016

At random time, I have threads stuck around the HashMap (mostly .put) and BoundedFifoBuffer (in AbstractCollection.remove) added in this PR. I think sessionTimestamps and buffer should have synchronization around them, as activeSessionsCount does.

Here are some more information from server.log and jstack. Soon after this exception appears in server.log, more and more threads will be stuck with the following stack trace, with sessionCreatedEvent, sessionDestroyedEvent, and sessionActivatedEndEvent:

[2016-11-11T14:34:23.172+0000] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=703 _ThreadName=ajp-thread-pool(14)] [timeMillis: 1478842463172] [levelValue: 800] [[
  org.glassfish.flashlight.impl.client.ReflectiveClientInvoker
java.lang.reflect.InvocationTargetException
CAUSE:  java.lang.ArrayIndexOutOfBoundsException: 11
id=47
target=org.glassfish.web.admin.monitor.SessionStatsProvider@436edf80
method=public void org.glassfish.web.admin.monitor.SessionStatsProvider.sessionCreatedEvent(java.lang.String,java.lang.String,java.lang.String)
paramNames=[sessionId, appName, hostName]
probeIndices=[0, 1, 2]
useProbeArgs=true
hasComputedParams=false]]
"ajp-thread-pool(23)" daemon prio=10 tid=0x00007f83c00e1800 nid=0x589f runnable [0x00007f8465d51000]
   java.lang.Thread.State: RUNNABLE
 at org.glassfish.web.admin.monitor.BoundedFifoBuffer.access$300(BoundedFifoBuffer.java:61)
 at org.glassfish.web.admin.monitor.BoundedFifoBuffer$1.next(BoundedFifoBuffer.java:332)
 at java.util.AbstractCollection.remove(AbstractCollection.java:290)
 at org.glassfish.web.admin.monitor.SessionStatsProvider.sessionDestroyedEvent(SessionStatsProvider.java:199)
 at sun.reflect.GeneratedMethodAccessor4056.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at org.glassfish.flashlight.impl.client.ReflectiveClientInvoker.methodInvoke(ReflectiveClientInvoker.java:173)
 at org.glassfish.flashlight.impl.client.ReflectiveClientInvoker.invoke(ReflectiveClientInvoker.java:155) at org.glassfish.flashlight.provider.FlashlightProbe.fireProbe(FlashlightProbe.java:180)
 at org.glassfish.flashlight.provider.ProbeRegistry.invokeProbe(ProbeRegistry.java:134)
 at org.glassfish.web.admin.monitor.SessionProbeProvider.sessionDestroyedEvent(SessionProbeProvider.java)
 at com.sun.enterprise.web.WebModule.sessionDestroyedEvent(WebModule.java:2221)
.....elided.....

Those threads quickly pile up and consume all CPUs.

At other time, one thread gets stuck like this, and spins on one core:

"ajp-thread-pool(1)" daemon prio=10 tid=0x00007f92582b1000 nid=0xb19 runnable [0x00007f921b0ee000]
   java.lang.Thread.State: RUNNABLE
        at java.util.HashMap.put(HashMap.java:494)
        at org.glassfish.web.admin.monitor.SessionStatsProvider.sessionCreatedEvent(SessionStatsProvider.java:174)
        at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.glassfish.flashlight.impl.client.ReflectiveClientInvoker.methodInvoke(ReflectiveClientInvoker.java:173)
        at org.glassfish.flashlight.impl.client.ReflectiveClientInvoker.invoke(ReflectiveClientInvoker.java:155)
        at org.glassfish.flashlight.provider.FlashlightProbe.fireProbe(FlashlightProbe.java:180)
        at org.glassfish.flashlight.provider.ProbeRegistry.invokeProbe(ProbeRegistry.java:134)
        at org.glassfish.web.admin.monitor.SessionProbeProvider.sessionCreatedEvent(SessionProbeProvider.java)
        at com.sun.enterprise.web.WebModule.sessionCreatedEvent(WebModule.java:2215)
.....elided....

Gradually, more threads fall into this state, each consumes one core fully. There are no relevant output in server.log

@smillidge
Copy link
Contributor

I've created an internal issue PAYARA-1224 for this to make it thread safe.

Pandrex247 pushed a commit that referenced this pull request Aug 30, 2022
FISH-6043 Configuring Payara Notification Logging Service causes NullPointerException
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.

4 participants