| Summary: | [dstore] getHostEnvironment returns an empty array immediately after connecting | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Petar Petrov <petar.petrov> | ||||
| Component: | RSE | Assignee: | David McKnight <dmcknigh> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dmcknigh, petar.petrov | ||||
| Version: | 3.1.1 | ||||||
| Target Milestone: | 3.4 M3 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 203008 [details]
patch to waitForInitialize() before getting the host env
Could you check if this patch fixes the issue?
I've committed the change to the HEAD stream. |
Build Identifier: 20110615-0604 DStoreShellService.getHostEnvironment() will return an empty array if called immediately after connecting Reproducible: Always Steps to Reproduce: Create a RSE connection configured to use the DStore shell subsystem. Execute the following code: for(ISubSystem subSystem : host.getSubSystems()) { if(subSystem instanceof IShellServiceSubSystem) { try { if(!subSystem.isConnected()) { IConnectorService connectorService = subSystem.getConnectorService(); connectorService.acquireCredentials(false); connectorService.connect(monitor); } IShellService shellService = ((IShellServiceSubSystem)subSystem).getShellService(); shellService.getHostEnvironment(); } catch(Exception e) { PluginLog.logError(e); } } } If the connection was disconnected the call to getHostEnvironment will return an empty array. If called after a few seconds, it will properly return the environment variables. If a call to isInitialized() is made right after connecting, it will return false. Looking at the DStoreShellService source code, it seems that all other public methods call waitForInitialize, while getHostEnvironment does not.