Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368914 - [shell] Updating the united shell property file sometimes isn't taken into account
Summary: [shell] Updating the united shell property file sometimes isn't taken into ac...
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: runtime (show other bugs)
Version: 3.5.0.M02   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 03:40 EST by Borislav Kapukaranov CLA
Modified: 2012-09-23 09:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Borislav Kapukaranov CLA 2012-01-18 03:40:29 EST
Updating the shell properties file sometimes doesn't work. Enabled is "true" but there is no open port or vice versa. 
This could be related with ConfigAdmin caches and the way they are updated.
Comment 1 Lazar Kirchev CLA 2012-01-20 11:35:19 EST
Fixed with commit http://git.eclipse.org/c/virgo/org.eclipse.virgo.nano.git/commit/?h=364571-introduce-nano

The problem occurs only when the telnet/ssh gets disabled (from true the enabled property is set to false). Also, if nano is restarted second time, the change is applied.

The problem is as follows:

When the console bundle starts it registers a ManagedService, which listens for its configurations. When the configuration is updated and nano restarted, the configuration admin keeps the old configuration until the update becomes available (through a call to ConfigAdmin). Meanwhile, before the updated configuration reaches the ConfigAdmin, the console starts and registers its ManagedService. Since the update is not available yet, the ManagedService gets the old configuration. If it says that telnet is enabled, a telnet server is started. Then comes the updated configuration. The console reads the new properties, but since there is already a running telnet server, it does not kill it - it does not know if there are open sessions. That is why it seems that the update is not applied. If nano is restarted again, when the console gets started it gets the updated configuration right from the start and does not start a telnet server.
 
If the update is from false to true this problem does not occur. When the console gets the old configuration first, it just does not start a telnet server. And when comes the updated configuration, it starts one.
 
This happens only in nano, since in it the osgi.clean property is false and caches are not cleared. In the other distributions the property is true, so config admin cache is cleared each time and upon start it has no console configuration until the one from the properties file gets registered.

The fix is very small - it just deletes upon stopping of nano the console configurations - the merged one, and the two specific.
Comment 3 Borislav Kapukaranov CLA 2012-01-20 12:02:39 EST
Made minor re-factoring with commit 41c8b44
Comment 4 Lazar Kirchev CLA 2012-09-23 09:07:46 EDT
Fixed.