You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pharo's testing framework automatically terminates any threads that were not cleaned up during a test run. If a TestResource, used to maintain an open Connection for various tests, is initialized during a test, the Connection's reading and writing threads will be terminated automatically.
In this scenario, the framework does not realize. The threads terminate and the Connection and Channel continue to believe they are open and connected.
There are different ways this could be handled.
Threads could automatically restart
The Connection could automatically close if the thread shuts down
The Connection could be alerted and fail any future send to #remoteSelf until the threads are restarted by the framework user
If the socket is open, I think 1 is probably the best choice for when the thread unexpectedly is terminated. If the socket is closed, it seems we should signal the normal closure procedure.
Note, this only applies when our threads unexpectedly shutdown. If they shutdown for expected reasons, that situation dictates the proper behavior.
The text was updated successfully, but these errors were encountered:
There is something additional to keep in mind, if the thread is terminated, it could be terminated partway through writing data on the socket. I don't know if we can determine -- reliably -- the amount of data that has already been written to the socket.
Restarting the thread could result in part of a (or an entire) message never making it to the remote side. At best, the Socket could close. At worst, the missing data could cause incorrect remote messages to be sent. Messages sent by the client might never return.
We do not have any way of knowing what the state of the communication is if the read/write threads die outside of our control. I think we need to close the Connection once detected.
The read or write threads could have been partway through a ready or write operation. We cannot safely continue. Messages could have been lost along the way.
Pharo's testing framework automatically terminates any threads that were not cleaned up during a test run. If a TestResource, used to maintain an open Connection for various tests, is initialized during a test, the Connection's reading and writing threads will be terminated automatically.
In this scenario, the framework does not realize. The threads terminate and the Connection and Channel continue to believe they are open and connected.
There are different ways this could be handled.
If the socket is open, I think 1 is probably the best choice for when the thread unexpectedly is terminated. If the socket is closed, it seems we should signal the normal closure procedure.
Note, this only applies when our threads unexpectedly shutdown. If they shutdown for expected reasons, that situation dictates the proper behavior.
The text was updated successfully, but these errors were encountered: