[JBoss JIRA] (HRJS-79) Registering listener with undefined listenerId does nothing
by Anna Manukyan (Jira)
[ https://issues.jboss.org/browse/HRJS-79?page=com.atlassian.jira.plugin.sy... ]
Anna Manukyan updated HRJS-79:
------------------------------
Description:
I was trying the following scenario: the case when the listenerId is passed while adding new listeners.
I was creating 3 listeners for create,modify and remove events. While adding listeners for modify and remove events I was passing the listenerId, but for modify event the listenerId was some nonexistent string.
I was curious what will happen. From the functional side nothing happened, so the modify event is not fired and from the logs I can see the following:
{code}
[2018-09-25T22:24:55.845] [DEBUG] client - Invoke addListener(msgId=464,event=create,listenerId=listener_465,opts=undefined) remotely
[2018-09-25T22:24:55.845] [TRACE] encoder - Encode operation with topology id 0
[2018-09-25T22:24:55.846] [TRACE] listener - Create listener emitter for connection 127.0.0.1:11222@conn_15 and listener with listenerId=listener_465
[2018-09-25T22:24:55.846] [TRACE] io_7 - Write buffer(msgId=464) to 127.0.0.1:11222@conn_15: A0D0031D2500000300010D00010D000C6C697374656E65725F343635000000000F
[2018-09-25T22:24:55.847] [TRACE] decoder - Read header(msgId=464): opCode=38, status=0, hasNewTopology=0
[2018-09-25T22:24:55.847] [TRACE] decoder - Call decode for request(msgId=464)
[2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - Complete success for request(msgId=464) with true
[2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - After decoding request(msgId=464), buffer size is 6, and offset 6
[2018-09-25T22:24:55.847] [DEBUG] client - Invoke addListener(msgId=466,event=modify,opts={"listenerId":"blblbl"}) locally
{color:red}[2018-09-25T22:24:55.848] [TRACE] listener - Create listener emitter for connection undefined and listener with listenerId=blblbl{color:red}
[2018-09-25T22:24:55.848] [DEBUG] client - Invoke addListener(msgId=467,event=remove,opts={"listenerId":"listener_465"}) locally
{code}
So the first line creates "create" event listener remotely. For the "modify" and "delete" events the "addLocalListener()" function is called. I am worried about the line marked in red, there the connection is passed as {color:red}undefined{color}.
I have found out that the connection parameter is not passed to protocol's addListener function when it is called from addLocalListener() function, but couldn't find a way to fix that.
Should it be that way?
I know that this kind of scenario is hardly possible but just in case the developer did some mistake, perhaps he/she may spend much time on finding why the event is not fired.
The code for generating this log is given here:
{code}
...code in the test...
it('fails when trying to attach to non-existent listener', function(done) {
client.then(function (client) {
var clientAddListenerCreate = client.addListener(
'create', function(key) { console.log('[Event] Created key: ' + key); });
var clientAddListeners = clientAddListenerCreate.then(
function(listenerId) {
// Multiple callbacks can be associated with a single client-side listener.
// This is achieved by registering listeners with the same listener id
// as shown in the example below.
var clientAddListenerModify = client.addListener(
'modify', function(key) { console.log('[Event] Modified key: ' + key); },
{listenerId: 'blblbl'});
var clientAddListenerRemove = client.addListener(
'remove', function(key) { console.log('[Event] Removed key: ' + key); },
{listenerId: listenerId});
return Promise.all([clientAddListenerModify, clientAddListenerRemove]);
});
var clientCreate = clientAddListeners.then(
function() { return client.putIfAbsent('eventful', 'v0'); });
var clientModify = clientCreate.then(
function() { return client.replace('eventful', 'v1'); });
var clientRemove = clientModify.then(
function() { return client.remove('eventful'); });
var clientRemoveListener =
Promise.all([clientAddListenerCreate, clientRemove]).then(
function(values) {
var listenerId = values[0];
return client.removeListener(listenerId);
});
}).catch(t.failed(done)).finally(done);
});
........
{code}
was:
I was trying the following scenario: the case when the listenerId is passed while adding new listeners.
I was creating 3 listeners for create,modify and remove events. While adding listeners for modify and remove events I was passing the listenerId, but for modify event the listenerId was some nonexistent string.
I was curious what will happen. From the functional side nothing happened, so the modify event is not fired and from the logs I can see the following:
{code}
[2018-09-25T22:24:55.845] [DEBUG] client - Invoke addListener(msgId=464,event=create,listenerId=listener_465,opts=undefined) remotely
[2018-09-25T22:24:55.845] [TRACE] encoder - Encode operation with topology id 0
[2018-09-25T22:24:55.846] [TRACE] listener - Create listener emitter for connection 127.0.0.1:11222@conn_15 and listener with listenerId=listener_465
[2018-09-25T22:24:55.846] [TRACE] io_7 - Write buffer(msgId=464) to 127.0.0.1:11222@conn_15: A0D0031D2500000300010D00010D000C6C697374656E65725F343635000000000F
[2018-09-25T22:24:55.847] [TRACE] decoder - Read header(msgId=464): opCode=38, status=0, hasNewTopology=0
[2018-09-25T22:24:55.847] [TRACE] decoder - Call decode for request(msgId=464)
[2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - Complete success for request(msgId=464) with true
[2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - After decoding request(msgId=464), buffer size is 6, and offset 6
[2018-09-25T22:24:55.847] [DEBUG] client - Invoke addListener(msgId=466,event=modify,opts={"listenerId":"blblbl"}) locally
{color:red}[2018-09-25T22:24:55.848] [TRACE] listener - Create listener emitter for connection undefined and listener with listenerId=blblbl{color}
[2018-09-25T22:24:55.848] [DEBUG] client - Invoke addListener(msgId=467,event=remove,opts={"listenerId":"listener_465"}) locally
{code}
So the first line creates "create" event listener remotely. For the "modify" and "delete" events the "addLocalListener()" function is called. I am worried about the line marked in red, there the connection is passed as {color:red}undefined{color}.
I have found out that the connection parameter is not passed to protocol's addListener function when it is called from addLocalListener() function, but couldn't find a way to fix that.
Should it be that way?
I know that this kind of scenario is hardly possible but just in case the developer did some mistake, perhaps he/she may spend much time on finding why the event is not fired.
The code for generating this log is given here:
{code}
...code in the test...
it('fails when trying to attach to non-existent listener', function(done) {
client.then(function (client) {
var clientAddListenerCreate = client.addListener(
'create', function(key) { console.log('[Event] Created key: ' + key); });
var clientAddListeners = clientAddListenerCreate.then(
function(listenerId) {
// Multiple callbacks can be associated with a single client-side listener.
// This is achieved by registering listeners with the same listener id
// as shown in the example below.
var clientAddListenerModify = client.addListener(
'modify', function(key) { console.log('[Event] Modified key: ' + key); },
{listenerId: 'blblbl'});
var clientAddListenerRemove = client.addListener(
'remove', function(key) { console.log('[Event] Removed key: ' + key); },
{listenerId: listenerId});
return Promise.all([clientAddListenerModify, clientAddListenerRemove]);
});
var clientCreate = clientAddListeners.then(
function() { return client.putIfAbsent('eventful', 'v0'); });
var clientModify = clientCreate.then(
function() { return client.replace('eventful', 'v1'); });
var clientRemove = clientModify.then(
function() { return client.remove('eventful'); });
var clientRemoveListener =
Promise.all([clientAddListenerCreate, clientRemove]).then(
function(values) {
var listenerId = values[0];
return client.removeListener(listenerId);
});
}).catch(t.failed(done)).finally(done);
});
........
{code}
> Registering listener with undefined listenerId does nothing
> -----------------------------------------------------------
>
> Key: HRJS-79
> URL: https://issues.jboss.org/browse/HRJS-79
> Project: Infinispan Javascript client
> Issue Type: Bug
> Reporter: Anna Manukyan
> Priority: Major
>
> I was trying the following scenario: the case when the listenerId is passed while adding new listeners.
> I was creating 3 listeners for create,modify and remove events. While adding listeners for modify and remove events I was passing the listenerId, but for modify event the listenerId was some nonexistent string.
> I was curious what will happen. From the functional side nothing happened, so the modify event is not fired and from the logs I can see the following:
> {code}
> [2018-09-25T22:24:55.845] [DEBUG] client - Invoke addListener(msgId=464,event=create,listenerId=listener_465,opts=undefined) remotely
> [2018-09-25T22:24:55.845] [TRACE] encoder - Encode operation with topology id 0
> [2018-09-25T22:24:55.846] [TRACE] listener - Create listener emitter for connection 127.0.0.1:11222@conn_15 and listener with listenerId=listener_465
> [2018-09-25T22:24:55.846] [TRACE] io_7 - Write buffer(msgId=464) to 127.0.0.1:11222@conn_15: A0D0031D2500000300010D00010D000C6C697374656E65725F343635000000000F
> [2018-09-25T22:24:55.847] [TRACE] decoder - Read header(msgId=464): opCode=38, status=0, hasNewTopology=0
> [2018-09-25T22:24:55.847] [TRACE] decoder - Call decode for request(msgId=464)
> [2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - Complete success for request(msgId=464) with true
> [2018-09-25T22:24:55.847] [TRACE] io_7_conn_15 - After decoding request(msgId=464), buffer size is 6, and offset 6
> [2018-09-25T22:24:55.847] [DEBUG] client - Invoke addListener(msgId=466,event=modify,opts={"listenerId":"blblbl"}) locally
> {color:red}[2018-09-25T22:24:55.848] [TRACE] listener - Create listener emitter for connection undefined and listener with listenerId=blblbl{color:red}
> [2018-09-25T22:24:55.848] [DEBUG] client - Invoke addListener(msgId=467,event=remove,opts={"listenerId":"listener_465"}) locally
> {code}
> So the first line creates "create" event listener remotely. For the "modify" and "delete" events the "addLocalListener()" function is called. I am worried about the line marked in red, there the connection is passed as {color:red}undefined{color}.
> I have found out that the connection parameter is not passed to protocol's addListener function when it is called from addLocalListener() function, but couldn't find a way to fix that.
> Should it be that way?
> I know that this kind of scenario is hardly possible but just in case the developer did some mistake, perhaps he/she may spend much time on finding why the event is not fired.
> The code for generating this log is given here:
> {code}
> ...code in the test...
> it('fails when trying to attach to non-existent listener', function(done) {
> client.then(function (client) {
> var clientAddListenerCreate = client.addListener(
> 'create', function(key) { console.log('[Event] Created key: ' + key); });
> var clientAddListeners = clientAddListenerCreate.then(
> function(listenerId) {
> // Multiple callbacks can be associated with a single client-side listener.
> // This is achieved by registering listeners with the same listener id
> // as shown in the example below.
> var clientAddListenerModify = client.addListener(
> 'modify', function(key) { console.log('[Event] Modified key: ' + key); },
> {listenerId: 'blblbl'});
> var clientAddListenerRemove = client.addListener(
> 'remove', function(key) { console.log('[Event] Removed key: ' + key); },
> {listenerId: listenerId});
> return Promise.all([clientAddListenerModify, clientAddListenerRemove]);
> });
> var clientCreate = clientAddListeners.then(
> function() { return client.putIfAbsent('eventful', 'v0'); });
> var clientModify = clientCreate.then(
> function() { return client.replace('eventful', 'v1'); });
> var clientRemove = clientModify.then(
> function() { return client.remove('eventful'); });
> var clientRemoveListener =
> Promise.all([clientAddListenerCreate, clientRemove]).then(
> function(values) {
> var listenerId = values[0];
> return client.removeListener(listenerId);
> });
> }).catch(t.failed(done)).finally(done);
> });
> ........
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 1 month
[JBoss JIRA] (ISPN-8564) Cannot select inner entities in Ickle
by Gustavo Lira (Jira)
[ https://issues.jboss.org/browse/ISPN-8564?page=com.atlassian.jira.plugin.... ]
Gustavo Lira commented on ISPN-8564:
------------------------------------
[~anistor] Hi Adrian. This issue was really fixed? I just saw a [PR|https://github.com/infinispan/infinispan/pull/5609] with a test case and you saying to not close the issue yet.
> Cannot select inner entities in Ickle
> -------------------------------------
>
> Key: ISPN-8564
> URL: https://issues.jboss.org/browse/ISPN-8564
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying, Remote Querying
> Affects Versions: 9.0.0.Final
> Reporter: Gustavo Fernandes
> Assignee: Adrian Nistor
> Priority: Major
> Fix For: 9.4.0.Final
>
>
> Consider a proto mapping:
> {code}
> message Parent {
> optional Child child;
> }
> message Child {
> optional string name = 1;
> }
> {code}
> It is not possible to select any of the Child attributes in the query. The following queries fail:
> {{SELECT p.child FROM Parent p}}
> Fails with ISPN028503
> {{SELECT p.child.name FROM Parent p}}
> Fails with ISPN028502: Unknown alias 'child'
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 1 month
[JBoss JIRA] (ISPN-8721) Clustered 2nd level cache sometimes throws NullPointerException when new node starts up
by Gustavo Lira (Jira)
[ https://issues.jboss.org/browse/ISPN-8721?page=com.atlassian.jira.plugin.... ]
Gustavo Lira closed ISPN-8721.
------------------------------
> Clustered 2nd level cache sometimes throws NullPointerException when new node starts up
> ---------------------------------------------------------------------------------------
>
> Key: ISPN-8721
> URL: https://issues.jboss.org/browse/ISPN-8721
> Project: Infinispan
> Issue Type: Bug
> Components: Hibernate Cache
> Affects Versions: 9.1.4.Final
> Environment: jvm 1.8
> Reporter: Tom Dearman
> Assignee: Tom Dearman
> Priority: Major
> Fix For: 9.4.0.Final
>
> Attachments: sample-app.cache.tar.gz
>
>
> There is a race condition in PutFromLoadValidator as it registers itself in the component registry before it is fully initialised. You can reproduce this by running the contained app against h2 server db. First start this app with default port. Then start the app on port '8080' and make a few requests to '/add' to create data. After that send continuous requests to '/update' in order change data and trigger the cache:
> for i in
> {code}
> {1..1000}
> ; do sleep 0.01; curl http://localhost:8080/update -X POST; done
> {code}
> Then start another instance of the app on port 8090:
> {code}
> java -jar test-app-0.0.1-SNAPSHOT.jar --server.port=8090
> {code}
> Most of the time one of the updates will fail and the logs will show the following:
> {code}
> 2018-01-23 15:36:46 [main] DEBUG o.h.c.i.access.PutFromLoadValidator - Interceptor chain was: [org.infinispan.interceptors.InvocationContextInterceptor@407a7f2a, org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor@4ea5b703, org.infinispan.interceptors.EntryWrappingInterceptor@2a7ed1f, org.infinispan.interceptors.InvalidationInterceptor@3fa247d1, org.infinispan.interceptors.CallInterceptor@2cb2fc20]
> 2018-01-23 15:36:46 [main] DEBUG o.h.c.i.access.PutFromLoadValidator - New interceptor chain is: [org.infinispan.interceptors.InvocationContextInterceptor@407a7f2a, org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor@4ea5b703, org.hibernate.cache.infinispan.access.NonTxPutFromLoadInterceptor@495ee280, org.infinispan.interceptors.EntryWrappingInterceptor@2a7ed1f, org.hibernate.cache.infinispan.access.NonTxInvalidationInterceptor@4fa1c212, org.infinispan.interceptors.CallInterceptor@2cb2fc20]
> 2018-01-23 15:36:46 [main] TRACE o.i.manager.DefaultCacheManager - About to wire and start cache test.app.data.User-pending-puts
> 2018-01-23 15:36:46 [remote-thread--p2-t1] ERROR o.i.i.InvocationContextInterceptor - ISPN000136: Error executing command BeginInvalidationCommand, writing keys test.app.data.User#2
> java.lang.NullPointerException: null
> at org.hibernate.cache.infinispan.access.PutFromLoadValidator.beginInvalidatingWithPFER(PutFromLoadValidator.java:561)
> at org.hibernate.cache.infinispan.access.PutFromLoadValidator.beginInvalidatingKey(PutFromLoadValidator.java:555)
> at org.hibernate.cache.infinispan.access.NonTxPutFromLoadInterceptor.visitInvalidateCommand(NonTxPutFromLoadInterceptor.java:70)
> at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitInvalidateCommand(AbstractLockingInterceptor.java:112)
> at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
> at org.infinispan.commands.AbstractVisitor.visitInvalidateCommand(AbstractVisitor.java:127)
> at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
> at org.infinispan.commands.remote.BaseRpcInvokingCommand.processVisitableCommand(BaseRpcInvokingCommand.java:43)
> at org.infinispan.commands.remote.SingleRpcCommand.perform(SingleRpcCommand.java:51)
> at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92)
> at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> 2018-01-23 15:36:47 [main] TRACE o.i.manager.DefaultCacheManager - Closing latch for cache test.app.data.User-pending-puts
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 1 month
[JBoss JIRA] (ISPN-9684) Remove CLI loader
by Tristan Tarrant (Jira)
Tristan Tarrant created ISPN-9684:
-------------------------------------
Summary: Remove CLI loader
Key: ISPN-9684
URL: https://issues.jboss.org/browse/ISPN-9684
Project: Infinispan
Issue Type: Sub-task
Components: Loaders and Stores
Reporter: Tristan Tarrant
Assignee: Tristan Tarrant
Fix For: 10.0.0.Final
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 1 month
[JBoss JIRA] (ISPN-9683) Remote getBulk methods from RemoteCache
by William Burns (Jira)
William Burns created ISPN-9683:
-----------------------------------
Summary: Remote getBulk methods from RemoteCache
Key: ISPN-9683
URL: https://issues.jboss.org/browse/ISPN-9683
Project: Infinispan
Issue Type: Sub-task
Components: Hot Rod
Reporter: William Burns
Fix For: 10.0.0.Final
The getBulk methods have been deprecated for a while on the RemoteCache. We have appropriate streaming based methods for keySet, entrySet and retrieveEntries methods which are much better.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 1 month