Skip to content
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

nonblock flag is lost during reconnect #3615

Closed
OKriw opened this issue Aug 7, 2018 · 0 comments
Closed

nonblock flag is lost during reconnect #3615

OKriw opened this issue Aug 7, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@OKriw
Copy link
Contributor

OKriw commented Aug 7, 2018

When logging to syslog we suffer from loss O_NONBLOCK flag and tarantool locks on write, that won't happen, because internal socket buffer is full.
How to reproduce:

#!/usr/bin/env tarantool                                                        
                                                                               
socket = require('socket')                                                      
log = require('log')                                                            
fio = require('fio')                                                            
                                                                                
path = fio.pathjoin(fio.cwd(), 'log_unix_socket_test.sock')                     
unix_socket = socket('AF_UNIX', 'SOCK_DGRAM', 0)                                
unix_socket:bind('unix/', path)                                                 
                                                                                
opt = string.format("syslog:server=unix:%s,identity=tarantool", path)           
res = 1                                                                         
buf = 'Started\n'                                                               
box.cfg{log = opt}                                               
log.info("Test socket syslog destination")                                                                                                   
while unix_socket:readable(1) do                                                                                                                 
    buf = buf .. unix_socket:recv(1000)                                         
    if buf:match('Test socket syslog destination') then res = 0 end             
end                                                                             
                                                                                
unix_socket:close()                                                             
os.remove(path)                                                                 
os.exit(res)       

Set log_nonblock is helpless - because we lose O_NONBLOCK when we do recconect to socket. So, tarantool hangs forever.

@OKriw OKriw added the bug Something isn't working label Aug 7, 2018
@OKriw OKriw changed the title nonblock flag is lost if during reconnect nonblock flag is lost during reconnect Aug 7, 2018
OKriw added a commit that referenced this issue Aug 7, 2018
During syslog reconnect we lose nonblock flag. THis leads to misbehavior
while logging. Tarantool hang forever

Closes #3615
@kyukhin kyukhin modified the milestones: 1.10.2, 1.9.2 Aug 8, 2018
OKriw added a commit that referenced this issue Aug 12, 2018
During syslog reconnect we lose nonblock flag. This leads to misbehavior
while logging. Tarantool hangs forever

Closes #3615
OKriw added a commit that referenced this issue Aug 12, 2018
During syslog reconnect we lose nonblock flag. This leads to misbehavior
while logging. Tarantool hangs forever

Closes #3615
OKriw added a commit that referenced this issue Aug 12, 2018
During syslog reconnect we lose nonblock flag. This leads to misbehavior
while logging. Tarantool hangs forever

Closes #3615
@OKriw OKriw self-assigned this Aug 13, 2018
OKriw added a commit that referenced this issue Aug 13, 2018
During syslog reconnect we lose nonblock flag. This leads to misbehavior
while logging. Tarantool hangs forever

Closes #3615
OKriw added a commit that referenced this issue Aug 13, 2018
We should test log_nonblock mode. In some cases the loss of this flag
lead to tarantool hanging forever. This tests checks such possibility.

gh-3615 loss of nonblock flag in logger
locker pushed a commit that referenced this issue Aug 14, 2018
We should test log_nonblock mode. In some cases the loss of this flag
lead to tarantool hanging forever. This tests checks such possibility.

Follow-up #3615
@locker locker closed this as completed in 878ff7f Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants