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

Łukasz Dywicki edited comment on PLC4X-344 at 5/31/22 12:15 PM:
----------------------------------------------------------------

Sorry for patch, I made it on top of 0.8 release I run, so it might not apply 
cleanly to current develop. Overall you can try to fix issue yourself - just 
adjust line 
[https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/transaction/RequestTransactionManager.java#L104]
 to have poll() instead of remove() and fence lower lines with null check. I 
think that's all we need to do to avoid NoSuchElementException you got.


was (Author: splatch):
Sorry for patch, I made it on top of 0.8 release I run, so it might not apply 
cleanly to current develop. Overall you can try to fix issue yourself - just 
adjust line 
[https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/transaction/RequestTransactionManager.java#L104]
 to have poll() instead of remove() and fence it with null check. I think 
that's all we need to do to avoid NoSuchElementException you got.

> 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.7#820007)

Reply via email to