[ 
https://issues.apache.org/jira/browse/PLC4X-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17620088#comment-17620088
 ] 

Christofer Dutz edited comment on PLC4X-344 at 10/19/22 8:09 AM:
-----------------------------------------------------------------

However ... at a closer look ... you did change one thing which I think is 
actually quite important: Now any call to endRequest is accepted ... so if I 
have a broken driver (Can happen quite often during development) and I call 
endRequest more than once, this will bring the system out of sync. In the 
initial version this would cause an error and that would make the driver 
developer spot the problem. 

So what's the reason you need this fix? From a more detailed look at your 
screenshot I think you did two things ... you changed the worklog.remove() to 
worklog.poll() with a null-check but a second change was to change the set to 
an atomic integer ... what was the reasoning behind this?

So I undid the Set->Atomic change ... and then I noticed you also changed the 
Executor from a Executors.newFixedThreadPool(4) to 
Executors.newScheduledThreadPool(4). What is the reasoning behind this?


was (Author: cdutz):
However ... at a closer look ... you did change one thing which I think is 
actually quite important: Now any call to endRequest is accepted ... so if I 
have a broken driver (Can happen quite often during development) and I call 
endRequest more than once, this will bring the system out of sync. In the 
initial version this would cause an error and that would make the driver 
developer spot the problem. 

So what's the reason you need this fix? From a more detailed look at your 
screenshot I think you did two things ... you changed the worklog.remove() to 
worklog.poll() with a null-check but a second change was to change the set to 
an atomic integer ... what was the reasoning behind this?

> spi.transaction.RequestTransactionManager is not thread safe
> ------------------------------------------------------------
>
>                 Key: PLC4X-344
>                 URL: https://issues.apache.org/jira/browse/PLC4X-344
>             Project: Apache PLC4X
>          Issue Type: Bug
>          Components: Driver-S7, PLC4J
>         Environment: Siemens IOT 2050, debian. PLC4J via kotlin
>            Reporter: Robin
>            Priority: Major
>         Attachments: PLC4X-344.patch, errorConnect.png
>
>
> When running a s7 connection to an PLC sometimes the connection halts and 
> this error is thrown in the log. It seems like the processWorklog function 
> uses a thread safe queue but is itself not threadsafe throwing this error.
>  
> We're using an single connection to the plc. Reading two datablocks. Each 
> datablock is read by a different handler running in a separate thread but 
> using the same instance of PLC4J.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to