Summary: | logind writes out session state file before creating fifo so users end up in CLOSING state | ||
---|---|---|---|
Product: | systemd | Reporter: | Ray Strode [halfline] <rstrode> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | CC: | colin, dwalsh, i.gnatenko.brain, pachoramos1, ph.wolfer, rstrode |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Ray Strode [halfline]
2013-07-24 20:40:09 UTC
cba38758b4d49c6fe7c2f0eea255e11ee9df23eb should fix the issue. Looks fine, thanks! Two comments, but these things probably don't matter that much in practice: 1) the state file will briefly begin its life with CLOSING written in it, which isn't really accurate, though maybe that's inconsequential. 2) you send out the reply before saving the state file, so, in theory, there's a small race where a client could get the reply and then proceed to check the state file and still read stale information. It's a pretty small race though. (In reply to comment #2) > Looks fine, thanks! > > Two comments, but these things probably don't matter that much in practice: > > 1) the state file will briefly begin its life with CLOSING written in it, > which isn't really accurate, though maybe that's inconsequential. No it will briefly have "OPENING" in it. See session_get_state(): it will return OPENING if there's the scope job still pending. The problem was simply that we saved the state at a time where the scope job was finished but the fifo not set up yet... > 2) you send out the reply before saving the state file, so, in theory, > there's a small race where a client could get the reply and then proceed to > check the state file and still read stale information. It's a pretty small > race though. Hmm, so that's indeed something to fix! Done so now in 7c6e214aeb141e6d514ddd9237a956278c4afc8c. Thanks for have a closer look, much appreciated! (In reply to comment #3) > No it will briefly have "OPENING" in it. See session_get_state(): it will > return OPENING if there's the scope job still pending. The problem was > simply that we saved the state at a time where the scope job was finished > but the fifo not set up yet... Ah okay. When I first started looking into this issue with dwalsh, I was originally looking at a stale git source checkout, and the behavior didn't match what I was reading, so I updated the tree, and then pretty soon after we saw the fifo_fd problem in the code. The last time I read the session_get_state() function I was looking at the stale source before updating, and it didn't have an OPENING state. > > 2) you send out the reply before saving the state file, so, in theory, > > there's a small race where a client could get the reply and then proceed to > > check the state file and still read stale information. It's a pretty small > > race though. > > Hmm, so that's indeed something to fix! > > Done so now in 7c6e214aeb141e6d514ddd9237a956278c4afc8c. cool. *** Bug 67267 has been marked as a duplicate of this bug. *** |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.