Re: Race condition in ogsmd

2010-02-04 Thread Gilles Filippini
Hi,

Jose Luis Perez Diez a écrit , Le 03/02/2010 13:43:
 Now I'm using the following path  log level CRITICAL for ogsmd:
 
 --- modem.py.oldWed Feb  3 09:04:31 2010
 +++ modem.pyWed Feb  3 13:24:31 2010
 @@ -194,7 +194,13 @@
  if not self._muxeriface.HasAutoSession():
  # abyss needs an open session before we can allocate 
 channels
  self._muxeriface.OpenSession( True, 98, 
 DEVICE_CALYPSO_PATH, 115200 )
 -pts, vc = self._muxeriface.AllocChannel( name, 
 self._channelmap[name] )
 +else:
 +sleep(0.1) #0.01 don't work sometimes
 +try:
 +pts, vc = self._muxeriface.AllocChannel( name, 
 self._channelmap[name] )
 +except Exception, jpde:
 +logger.critical(Error alocating channel %s : %s, name,jpde)
 +return 
  return str(pts)
 
  def dataPort( self ):

I was curious about the need for the sleep statement since I expected
the exception handling to be enough since it triggers a retry after 2
seconds. But removing it, ogsmd retries allocating the missing channel
in vain: if it doesn't work the first time, it won't work the others.
Here is the failure pattern which occurs forever:

* Exception: org.freesmartphone.GSM.MUX.NoChannel: Modem does not
provide this channel
* could not open channel CALL, retrying in 2 seconds

I've tried:
* setting a sleep between _ModemOn() and the first channel opening, to
check whether the muxer need some more time to initialize = no luck;
* changing the channels order so that 'ogsmd.call' be opened first =
third channel opening fails whatever their order is.

Seems that the place you put the sleep statement at is the only one
right: the muxer just can't cope opening these 3 channels without
waiting a bit between them.

So, please, developers, apply the Jose's patch :)

BTW, I've a - maybe naive - question: shouldn't the _ModemOn and
_ModemOff low level methods be implemented into libgsm0710mux?

Thanks,

_g.



signature.asc
Description: OpenPGP digital signature
___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: Race condition in ogsmd

2010-02-03 Thread Jose Luis Perez Diez
A Dimecres, 3 de de febrer de 2010 00:43:59, Gilles Filippini va escriure:
 The race takes place in subsystems/ogsmd/modems/ti_calypso/modem.py, in
 the TiCalypso::pathfactory method at the line:
 
 pts, vc = self._muxeriface.AllocChannel( name, self._channelmap[name] )
 
 This line fails silently for the 'ogsmd.call' channel when the loglevel
 is = INFO. Adding a sleep(1) before this line fixes it reproducibly.
 

Thanks I was investigating the problem too using exception handling.

Now I'm using the following path  log level CRITICAL for ogsmd:

--- modem.py.oldWed Feb  3 09:04:31 2010
+++ modem.pyWed Feb  3 13:24:31 2010
@@ -194,7 +194,13 @@
 if not self._muxeriface.HasAutoSession():
 # abyss needs an open session before we can allocate 
channels
 self._muxeriface.OpenSession( True, 98, 
DEVICE_CALYPSO_PATH, 115200 )
-pts, vc = self._muxeriface.AllocChannel( name, 
self._channelmap[name] )
+else:
+sleep(0.1) #0.01 don't work sometimes
+try:
+pts, vc = self._muxeriface.AllocChannel( name, 
self._channelmap[name] )
+except Exception, jpde:
+logger.critical(Error alocating channel %s : %s, name,jpde)
+return 
 return str(pts)

 def dataPort( self ):

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland