[GitHub] [plc4x] hutcheb opened a new pull request #207: Fix for connection pool, unable to reconnect after failed connection.

2020-11-27 Thread GitBox


hutcheb opened a new pull request #207:
URL: https://github.com/apache/plc4x/pull/207


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




AW: AW: Test on plc4x-pool2

2020-11-27 Thread Julian Feinauer
Hi,

first, thanks for reporting.
As discussed in Slack we try to fix the issue and I think I already pushed a 
fix.

So just for the list to notice : )

Julian

Von: Stefano Bossi 
Datum: Freitag, 27. November 2020 um 09:26
An: dev@plc4x.apache.org 
Betreff: Re: AW: Test on plc4x-pool2
ok,

l'et's wait Julian, who is probably doing his father work :-D

Anyway, Netty is really hard to fine tune!

Regards,
S.

On 27/11/2020 08:52, Christofer Dutz wrote:

Hi Stefano,



I really wonder how often I will end up looking up this stupid 
java.lang.UnsupportedOperationException …

I have to admit that for me this is one of the most annoying things with Netty 
:-/



But seeing the actual error is coming from the pool, I guess Julian should 
probably help you with this, I doubt this is something I can help with.



Chris



Von: Stefano Bossi 

Datum: Donnerstag, 26. November 2020 um 23:16

An: dev@plc4x.apache.org 


Betreff: Test on plc4x-pool2

Hi Julian,



I have tried to integrate in my code the new pool library you wrote but without 
success, I have probably did something wrong.



I am started trying to work with the HelloPlc4x





PlcDriverManager manager = new PlcDriverManager();



PlcDriverManager cached = new CachedDriverManager(connectionString, 
() -> {



try {



return manager.getConnection(connectionString);



} catch (PlcConnectionException e) {



e.printStackTrace();



}



return null;



});



PlcConnection plcConnection = 
cached.getConnection(connectionString);



// Check if this connection support reading of data.



if (!plcConnection.getMetadata().canRead()) {



logger.error("This connection doesn't support reading.");



return;



}











integrate When the code reach the line plcConnection.getMetadata().canRead()



 integrate an exception is rised:







bash-3.2$  /Users/fox/.jenv/versions/openjdk64-13.0.2/bin/java 
-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:51806 
-ea -Dfile.encoding=UTF-8 
@/var/folders/p1/lb5grfpn3tncxdtrptqq9fw4gp/T/cp_dkqa6x1i5h7yfdha7mxc6sn5h.argfile
 it.fox.datapicker.HelloPlc4x



2020-11-26 23:09:30,677 main DEBUG Apache Log4j Core 2.14.0 initializing 
configuration 
XmlConfiguration[location=/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml]



2020-11-26 23:09:30,684 main DEBUG Installed 1 script engine



Warning: Nashorn engine is planned to be removed from a future JDK release



2020-11-26 23:09:30,885 main DEBUG Oracle Nashorn version: 13.0.2, language: 
ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, 
Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory 
class: jdk.nashorn.api.scripting.NashornScriptEngineFactory



2020-11-26 23:09:30,885 main DEBUG PluginManager 'Core' found 122 plugins



2020-11-26 23:09:30,885 main DEBUG PluginManager 'Level' found 0 plugins



2020-11-26 23:09:30,889 main DEBUG PluginManager 'Lookup' found 16 plugins



2020-11-26 23:09:30,890 main DEBUG Building Plugin[name=layout, 
class=org.apache.logging.log4j.core.layout.PatternLayout].



2020-11-26 23:09:30,899 main DEBUG PluginManager 'TypeConverter' found 26 
plugins



2020-11-26 23:09:30,911 main DEBUG PatternLayout$Builder(pattern="[%-5level] 
%d{HH:mm:ss.SSS} %logger{36}.%M() - %msg%n", PatternSelector=null, 
Configuration(/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml), Replace=null, charset="null", 
alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", 
header="null", footer="null")



2020-11-26 23:09:30,911 main DEBUG PluginManager 'Converter' found 44 plugins



2020-11-26 23:09:30,912 main DEBUG Building Plugin[name=appender, 
class=org.apache.logging.log4j.core.appender.ConsoleAppender].



2020-11-26 23:09:30,917 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT", 
follow="null", direct="null", bufferedIo="null", bufferSize="null", 
immediateFlush="null", ignoreExceptions="null", PatternLayout([%-5level] 
%d{HH:mm:ss.SSS} %logger{36}.%M() - %msg%n), name="Console", 
Configuration(/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml), Filter=null, ={})



2020-11-26 23:09:30,919 main DEBUG Starting OutputStreamManager 
SYSTEM_OUT.false.false



2020-11-26 23:09:30,919 main DEBUG Building Plugin[name=appenders, 
class=org.apache.logging.log4j.core.config.AppendersPlugin].



2020-11-26 23:09:30,922 main DEBUG createAppenders(={Console})



2020-11-26 23:09:30,922 main DEBUG Building Plugin[name=AppenderRef, 
class=org.apache.logging.log4j.core.config.AppenderRef].



2020-11-26 23:09:30,926 main DEBUG createAppenderRef(ref="Console", 
level="TRACE", 

Re: AW: Test on plc4x-pool2

2020-11-27 Thread Stefano Bossi

ok,

l'et's wait Julian, who is probably doing his father work :-D

Anyway, Netty is really hard to fine tune!

Regards,
S.


On 27/11/2020 08:52, Christofer Dutz wrote:

Hi Stefano,

I really wonder how often I will end up looking up this stupid 
java.lang.UnsupportedOperationException …
I have to admit that for me this is one of the most annoying things with Netty 
:-/

But seeing the actual error is coming from the pool, I guess Julian should 
probably help you with this, I doubt this is something I can help with.

Chris

Von: Stefano Bossi 
Datum: Donnerstag, 26. November 2020 um 23:16
An: dev@plc4x.apache.org 
Betreff: Test on plc4x-pool2
Hi Julian,

I have tried to integrate in my code the new pool library you wrote but without 
success, I have probably did something wrong.

I am started trying to work with the HelloPlc4x


 PlcDriverManager manager = new PlcDriverManager();

 PlcDriverManager cached = new CachedDriverManager(connectionString, 
() -> {

 try {

 return manager.getConnection(connectionString);

 } catch (PlcConnectionException e) {

 e.printStackTrace();

 }

 return null;

 });

 PlcConnection plcConnection = 
cached.getConnection(connectionString);

 // Check if this connection support reading of data.

 if (!plcConnection.getMetadata().canRead()) {

 logger.error("This connection doesn't support reading.");

 return;

 }





integrate When the code reach the line plcConnection.getMetadata().canRead()

  integrate an exception is rised:



bash-3.2$  /Users/fox/.jenv/versions/openjdk64-13.0.2/bin/java 
-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:51806 
-ea -Dfile.encoding=UTF-8 
@/var/folders/p1/lb5grfpn3tncxdtrptqq9fw4gp/T/cp_dkqa6x1i5h7yfdha7mxc6sn5h.argfile
 it.fox.datapicker.HelloPlc4x

2020-11-26 23:09:30,677 main DEBUG Apache Log4j Core 2.14.0 initializing 
configuration 
XmlConfiguration[location=/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml]

2020-11-26 23:09:30,684 main DEBUG Installed 1 script engine

Warning: Nashorn engine is planned to be removed from a future JDK release

2020-11-26 23:09:30,885 main DEBUG Oracle Nashorn version: 13.0.2, language: 
ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, 
Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory 
class: jdk.nashorn.api.scripting.NashornScriptEngineFactory

2020-11-26 23:09:30,885 main DEBUG PluginManager 'Core' found 122 plugins

2020-11-26 23:09:30,885 main DEBUG PluginManager 'Level' found 0 plugins

2020-11-26 23:09:30,889 main DEBUG PluginManager 'Lookup' found 16 plugins

2020-11-26 23:09:30,890 main DEBUG Building Plugin[name=layout, 
class=org.apache.logging.log4j.core.layout.PatternLayout].

2020-11-26 23:09:30,899 main DEBUG PluginManager 'TypeConverter' found 26 
plugins

2020-11-26 23:09:30,911 main DEBUG PatternLayout$Builder(pattern="[%-5level] %d{HH:mm:ss.SSS} %logger{36}.%M() - %msg%n", 
PatternSelector=null, Configuration(/Users/fox/Documents/workspace/2020-06-30 - HelloPlc4x/bin/main/log4j2.xml), Replace=null, 
charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", 
header="null", footer="null")

2020-11-26 23:09:30,911 main DEBUG PluginManager 'Converter' found 44 plugins

2020-11-26 23:09:30,912 main DEBUG Building Plugin[name=appender, 
class=org.apache.logging.log4j.core.appender.ConsoleAppender].

2020-11-26 23:09:30,917 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT", follow="null", direct="null", 
bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="null", PatternLayout([%-5level] 
%d{HH:mm:ss.SSS} %logger{36}.%M() - %msg%n), name="Console", Configuration(/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml), Filter=null, ={})

2020-11-26 23:09:30,919 main DEBUG Starting OutputStreamManager 
SYSTEM_OUT.false.false

2020-11-26 23:09:30,919 main DEBUG Building Plugin[name=appenders, 
class=org.apache.logging.log4j.core.config.AppendersPlugin].

2020-11-26 23:09:30,922 main DEBUG createAppenders(={Console})

2020-11-26 23:09:30,922 main DEBUG Building Plugin[name=AppenderRef, 
class=org.apache.logging.log4j.core.config.AppenderRef].

2020-11-26 23:09:30,926 main DEBUG createAppenderRef(ref="Console", 
level="TRACE", Filter=null)

2020-11-26 23:09:30,926 main DEBUG Building Plugin[name=root, 
class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].

2020-11-26 23:09:30,927 main DEBUG createLogger(additivity="false", level="DEBUG", 
includeLocation="null", ={Console}, ={}, Configuration(/Users/fox/Documents/workspace/2020-06-30 - 
HelloPlc4x/bin/main/log4j2.xml), Filter=null)

2020-11-26 23:09:30,929 main DEBUG Building Plugin[name=loggers,