#9433: File locking broken on AFP mounts
-------------------------------------------+--------------------------------
          Reporter:  rndblnch              |         Owner:  nobody
            Status:  new                   |     Milestone:        
         Component:  File uploads/storage  |       Version:  1.0   
        Resolution:                        |      Keywords:        
             Stage:  Accepted              |     Has_patch:  1     
        Needs_docs:  0                     |   Needs_tests:  0     
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Changes (by anonymous):

  * has_patch:  0 => 1

Comment:

 Replying to [comment:1 mtredinnick]:
 > We're not going to revert that change for one particular sort of
 filesystem on one particular operating system, since it fixes a much
 broader class of problems. That would be very counter-productive.
 I understand that, that is why i said it is a workaround (not a fix).
 I mentioned it because it can help other people before we find a proper
 fix.

 [[BR]]



 > So the real solution here is coming up with a way to work out when that
 locking attempt won't work. Since we're using the recommended approach to
 file locking, file systems that don't support it will need specific
 workarounds (or a warning saying one can't use them for that purpose).
 Assuming POSIX-like behaviour is quite valid, but exceptional handling for
 edge-cases is reasonable if we can detect them.

 The problem is that the behaviour is not consistant on the whole
 filesystem: local volumes are ok, volumes mounted via AFP are not.
 So special casing at import-time of django.core.files.locks id not
 possible.
 I propose the following solution:
 in the "posix" case, enclosing the calls to fcntl.lockf in a try block and
 in case of IOError for "Operation not supported" error, defaults silently
 to do nothing (which is the fallback already used when fcntl is not
 available.

 I've attached a patch against trunk.


 [[BR]]



 > You have one of these filesystems available. So can you look up how we
 can detect the problem? Does `flock()` work in those cases and, if so, is
 it possible to try `lockf()` and, if that fails, fall back to `flock()`?
 Do some experiments and see what you can come up with.

 Falling back to flock does not help, it's a do nothing operation on AFP
 volumes.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9433#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to