[PYTHON] Possible bugs revealed by socket_wrapper

Jeremy Allison jra at samba.org
Tue Nov 13 18:32:39 UTC 2018


On Tue, Nov 13, 2018 at 06:54:03PM +0100, Andreas Schneider via samba-technical wrote:
> On Monday, 12 November 2018 18:42:48 CET Andreas Schneider via samba-technical 
> wrote:
> > Hi,
> > 
> > we have socket_wrapper 1.2.0 with threading support ready. So I've pushed
> > the changes to the gitlab CI to see if everything is working.
> > 
> > It doesn't work and revealed some bugs :-)
> > 
> > New in socket_wrapper 1.2.0 is that we have a default limit of handling
> > 65535 open sockets! This can be increased if needed. However if we try to
> > setup the chgdcpass environment samba-tool wants to open 1 million sockets!
> > 
> > It is running:
> > 
> > python ./bin/samba-tool domainprovision --configfile=/home/gitlab-runner/
> > samba/st/chgdcpass/etc/smb.conf --host-name=chgdcpass --host-ip=127.0.0.32
> > -- quiet --domain=CHDCDOMAIN --realm=CHGDCPASSWORD.SAMBA.EXAMPLE.COM
> > --domain- sid=S-1-5-21-1879926001-2232171230-2460190490
> > --adminpass=chgDCpass1 -- krbtgtpass=krbtgtchgDCpass1
> > --machinepass=machinechgDCpass1 --root=gitlab- runner --server-role=domain
> > controller --function-level=2008 --dns- backend=BIND9_DLZ
> > 
> > Which after some time starts to report that it reached the limit!
> > 
> > ...
> > SWRAP_ERROR[python (20259)] - find_socket_info_index: The max socket index
> > limit of 65535 has been reached, trying to add 65855
> > SWRAP_ERROR[python (20259)] - find_socket_info_index: The max socket index
> > limit of 65535 has been reached, trying to add 65856
> > ...
> 
> I think I know what is going on. We need to remove that debug message. And the 
> reason is that this particular python version does the following:
> 
>     for (fd = 0; fd <= getdtablesize(); fd++) {
>         close(fd)
>     };
> 
> 
> Which results in a debug message for each value which is over our limit and 
> the debug messages are just taking to long to be printed.
> 
> I think we just need to remove the log statement.
> Checking with gitlab CI now.

Wow, that's a really dumb thing to do (the for
loop over getdtablesize()) !

getdtablesize can return -1...



More information about the samba-technical mailing list