simbabarry / smslib

Automatically exported from code.google.com/p/smslib
0 stars 0 forks source link

SMSServer runonce command does not exit as expected #454

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I notice that the -runonce parameter does not exit as documented . The 
SMSServer process continues to run in the command line window.
While i can kill the task after a certain time period, this may not be the best 
alternative.

The command I use (as per the doc) is (the conf. file is in the same directory 
as the smsserver jar file)
java org.smslib.smsserver.SMSServer -runonce

(my smsserver jar file is versioned as smsserver-3.5.1)

Appreciate your response on this

Original issue reported on code.google.com by ma...@simplifytek.com on 26 Jan 2012 at 10:34

GoogleCodeExporter commented 9 years ago

Original comment by T.Delenikas on 28 Jan 2012 at 11:05

GoogleCodeExporter commented 9 years ago

Original comment by T.Delenikas on 28 Jan 2012 at 11:11

GoogleCodeExporter commented 9 years ago
Can you please confirm this small fix?

http://code.google.com/p/smslib/source/detail?r=2323

Original comment by T.Delenikas on 28 Jan 2012 at 11:13

GoogleCodeExporter commented 9 years ago
Hi,
It almost did look like this fixed the problem when I incorporated this change 
and ran the program. But then, when I checked it looked like it had actually 
introduced another issue. The smsserver does exit the first time around when 
the message/s are fresh without any status marked. But it actually does not 
send the message at all and marks it as 'U'. And during a subsequent run, the 
same behaviour (of not exiting) is noticed.
A question : I notice that your change is in the 'InboundPollingThread' class. 
This issue is for 'outbound' messages. Am I getting something wrong here ?
As such, I did re-try by introducing similar code in the 
'OutboundPollingThread' class, to no effect.
I had to revert back to my earlier smsserver program which does send the 
messages, but keeps running :-(
Note: My test case involves trying to send around 100 messages. For the sake of 
testing the 1st and 100th messages are valid , rest are invalid no.'s. I did 
play around with combinations of batch_size (reduced it to 10), retries 
(reduced it to 0) and settings.outbound_interval (reduced it to 5). This 
combination helped mark the status for all the 100 messages to atleast 'U' 
(after around 40 minutes), with some invalid recipients marked as 'F'.Some 
combinations keep the invalid messages also in the 'Q'.
Not sure "What is the best configuration to send around 100 messages with a 
combination of valid and invalid recipients/network issues in sending" 

Original comment by ma...@simplifytek.com on 30 Jan 2012 at 12:39

GoogleCodeExporter commented 9 years ago
Hi,

The "-runonce" switch is a switch that I should never add. It seemed like a 
valid request at that time, but it's difficult to implement. What if you have 
1000000 messages queued in the database? What does "run once" mean in this 
case? Run for a week and exit?

Anyway, I would suggest to switch to the "daemon" mode, i.e. run SMSServer and 
leave it running. It will save you much trouble.

Original comment by T.Delenikas on 3 Feb 2012 at 6:41

GoogleCodeExporter commented 9 years ago
Well, my workload is in the order of 100/200 messages.I do not want to leave 
the program running when it has actually sent out the messages. This causes an 
issue when I populate more messages at a later juncture. I notice that 
smsserver is rather inconsistent as a daemon process.Messages that are 
populated subsequently are not sent (this is possibly another bug) I would 
rather stop it after having sent out a set of messages and start it once again 
when i need to send the next set of messages (it does work fine in that 
situation).

Original comment by ma...@simplifytek.com on 3 Feb 2012 at 7:57

GoogleCodeExporter commented 9 years ago
''I notice that smsserver is rather inconsistent as a daemon process.Messages 
that are populated subsequently are not sent (this is possibly another bug)''

Lets put our attention here please!

This was a very old issue which is fixed. I am also running a multi-modem 
installation with SMSServer which has not been restarted for months.

What database are you using?
Are you saying that you insert a record in the smsserver_out table and that 
message never gets sent?

Original comment by T.Delenikas on 3 Feb 2012 at 7:19

GoogleCodeExporter commented 9 years ago

Original comment by T.Delenikas on 10 Feb 2012 at 8:47