Bug 12979 - The Samba response a STATUS_PENDING but a full response missed when get_share_mode_lock_internal Could not get share mode locker .
The Samba response a STATUS_PENDING but a full response missed when get_shar...
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.2.12
x64 Linux
: P5 normal
: ---
Assigned To: Ralph Böhme
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-21 09:17 UTC by Lihaitao
Modified: 2017-09-17 08:42 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lihaitao 2017-08-21 09:17:40 UTC
I have a scripts on windows to create files on a samba server.
Some times the scripts failuer for waiting samba's response.

A wireshark's captur shows samba's response is "Create Response, Error: STATUS_PENDING" and a full response doesn't come later.

I have read the microsoft's  article. It's said 
"An interim response indicates to the client that the request has been received and a full response will come later."
https://msdn.microsoft.com/en-us/library/cc246721.aspx

The samba's log shows that time there is an errors  "fd_open" and "get_share_mode_lock_internal"
-------------------------
../source3/smbd/open.c:408(fd_open)
fd_open: name "filename", flags = 04002 mode = 0666, fd = -1.  Resource temporarily unavailable
......
../source3/locking/share_mode_lock.c:341(get_share_mode_lock_internal)  get_share_mode_lock_internal: Could not get share mode lock
......
../source3/smbd/open.c:2759(open_file_ntcreate) No share mode lock found after EWOULDBLOCK, retrying sync
-------------------------
I have read the source,the simple logic is like the next.The logic shows while share mode lock is null,a call back event is missing. I think it is the full response's event. 
---------the simple source logic--------------
schedule_defer_open
    defer_open(lck,.......				
		
	if (lck) { //lck is not NULL
			……				
		watch_req = dbwrap_record_watch_send( //create the watcher
			……
		tevent_req_set_callback(watch_req, defer_open_done, //add the call back event's 
            		……
	}
-----------------------
A STATUS_PENDING is responsed but a full response missed when get_share_mode_lock_internal Could not get share mode lockget locker.
I think it is a bug.

script's main code
---------------
set objFs = CreateObject("scripting.filesystemobject")
Set objTxtSt = objFs.CreateTextFile(strCSV1, True)
objTxtSt.Close
---------------
Comment 1 Stefan Metzmacher 2017-08-21 09:30:08 UTC
Ralph, isn't that the EAGAIN problem we looked at a few weeks ago?
Comment 2 Lihaitao 2017-08-21 10:01:26 UTC
(In reply to Stefan Metzmacher from comment #1)
Thank you for your help.
Did the EAGAIN problem has a bug number.
Comment 3 Ralph Böhme 2017-08-21 11:36:15 UTC
Hm, iirc that was EINTR in bug #12853.
Comment 4 Lihaitao 2017-08-22 02:21:03 UTC
(In reply to Ralph Böhme from comment #3)
Thank you for your help.
It isn't the same problem to bug #12853.
I have two problems. 1
1: The full response is missing after a STATUS_PENDING response.
2: The reason of get_share_mode_lock_internal's "Could not get share mode lock".
Comment 5 Lihaitao 2017-08-22 03:56:20 UTC
Created attachment 13487 [details]
The debug logs for  Samba response a STATUS_PENDING but a full response missed
Comment 7 Volker Lendecke 2017-08-31 06:29:16 UTC
For the reference: The reporter has asked to delete the attachment. That's why I put this to private.
Comment 9 Lihaitao 2017-08-31 06:54:03 UTC
(In reply to Volker Lendecke from comment #7)
Thank you for your help.
Another debug log which the same as the attachment has been added as comment #6.
Comment 10 Björn Jacke 2017-09-01 11:57:10 UTC
The content of attachment 13487 [details] has been deleted for the following reason:

requested by user