-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pings are occasionally being sent to non-Snap sockets (concrete example: PostgreSQL) #10
Comments
Yeah, it turns out my "tenuous" understanding of how file descriptor indexes are allocated was in fact completely wrong. File descriptor indexes are regularly reused, and Linux and Solaris at least seem to assign the lowest available descriptor index whenever a new descriptor is created. So I feel pretty confident that this is indeed a use-after-close fault. |
Why doesn't websockets-snap use |
This should be fixed in the latest release. |
I think this is the same bug that I was observing when I made pull request #13. Though my pull request made the problem less frequent, it didn't solve the problem. After some investigation, I think that my problem stemmed from using In the short term, switching to using |
I am definitely seeing errors in PostgreSQL's log, as before - so something is still going wrong - but unfortunately I haven't been able to put much time into it. As far as I can tell, I have disabled |
@elliottt I will merge in your patch tomorrow, although I think I will rewrite it a bit and put into a different part of the code. Thanks! |
@ocharles, you're still seeing the error even with the ping thread disabled? If so, that totally blows my theory :) |
@elliottt I think I found the issue. Due to a terrible oversight on my side there was no real sharing of information of when the parse end or write end were closed -- both had to detect it separately. Would you be willing to test the latest master branch? |
Absolutely! I'll test today. Thanks! On Sat, Feb 14, 2015, 06:43 Jasper Van der Jeugt [email protected]
|
Everything looks fine here, but I'm testing with a smaller dataset than before. I can give you more definitive results on Monday. |
I can also test this in production on Monday and see if I still get the same random error messages from PostgreSQL |
Any updates on this? |
This possible fix is included in |
Added an item to this weeks to-do list to have a look at this. |
Unfortunately, I can still see
in our PostgreSQL logs which suggests this is still happening. |
Ahh, apparently, returning the lowest available descriptor index is something the POSIX standard specifies. (Why? That honestly doesn't make sense to me...) So yeah, use-after-close is a real problem on anything that conforms to that dictum. |
@jaspervdj Is the 0.9.3.0 release available somewhere? (I don't see it on hackage, or a tag on the repo.) |
@creswick 0.9.3.0 is on Hackage, as is 0.9.4.0 |
@ocharles am I just looking in the wrong place? I don't see them here: http://hackage.haskell.org/package/websockets-snap |
The versions are for |
ah, thanks! I am still seeing the problem with websockets-0.9.4.0, unfortunately. |
This is a bit of weird bug, but I'm seeing pings from
websockets-snap
being sent to an openpostgres
connection. I previously thought this was a bug withpostgresql-simple
, as you can read about here.My guess is summarized in this IRC log:
The text was updated successfully, but these errors were encountered: