Unity 8 doesn't allow multiple Mir connections from an application instance

Bug #1675448 reported by Brandon Schaefer
32
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Michał Sawicz
qtmir (Ubuntu)
Fix Released
Critical
Daniel d'Andrada
unity8 (Ubuntu)
Invalid
High
Daniel d'Andrada

Bug Description

Some clients like to probe to see if a mir connection is available such as SDL2 and SDL1.2.

This is an issue in U8 as it doesnt seem to allow multiple connections in one process.

Example:
http://paste.ubuntu.com/24235399/

Output on U8:
http://paste.ubuntu.com/24235406/

==== Proposed solution ====

Related to bug #1589637

We need to accept multiple connections from the same application instance, relying on ubuntu-app-launch to tell us about instances and their lifecycle.

Related branches

Revision history for this message
Michał Sawicz (saviq) wrote : Re: Unity 8 doesnt allow multiple mir connections from an application instance

Not a duplicate after all:

<Saviq> bschaefer, about bug #1675448 you say that SDL likes to probe the display server, how would that affect launching an app? it drops the probing connection and reconnects from scratch after deciding it's fine?
<bschaefer> yeah, just need to politely mention we dont want to support that and dont want to support anything mir related long term until we have 1.0
<bschaefer> Saviq, soo with SDL2 (recently upstreamed and not released) and SDL1.2
<bschaefer> it probes if mir is around by simply attempting to connect to the mir server
 checks if its valid, releases the connection
 then runs with the video driver which will re-connect to the display server
 in the same process
<bschaefer> Saviq, theres not a good way to cache this connection as well (only way would be a global variable MirConnection* which i would like to avoid 100%)
<Saviq> dandrader, you might want to have that in mind ↑ when looking at multi-instance apps, bug #1675448 might not really be a duplicate after all
<dandrader> Saviq, ack
<Saviq> I'm actually not sure how to solve that wrt. splash screens right now
 'cause the first connection would be hooked up to the Application object that's "waiting" for a connection, then that connection gets dropped and we get a new one
 so how do we differentiate that from a new instance altogether? I suppose through UAL instances maybe?
<bschaefer> hmm
<Saviq> so we maintain a 1:1 mapping between UAL's instance and our Application, and we collect multiple connections for the same instance under the same Application object
<dandrader> Saviq, agreed it looks like a separate issue
<dandrader> (that "duplicate "bug)
<bschaefer> yeah i wasnt sure if it was
 but if a connection releases it before a new one comes it *its closed* right?
<bschaefer> and any connections after the release would be void
<Saviq> bschaefer, I suppose we can rely on UAL telling us when an application instance is really gone
<bschaefer> Saviq, that should be a way to do it (though not sure if its *easy* to do)
<bschaefer> does U8 only know about an application on the first mir_connection?

summary: - Unity 8 doesnt allow multiple mir connections in a single client
+ Unity 8 doesnt allow multiple mir connections from an application
+ instance
Changed in unity8 (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in canonical-devices-system-image:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Michał Sawicz (saviq)
milestone: none → u8c-2
Changed in qtmir (Ubuntu):
status: New → Triaged
importance: Undecided → High
Michał Sawicz (saviq)
description: updated
tags: added: unity8-desktop
Revision history for this message
Stephen M. Webb (bregma) wrote :

Turns out this is the cause of launch failures of any GTK+, Qt, or SDL application that is trying to use Mir instead of X11.

Changed in canonical-devices-system-image:
importance: High → Critical
Changed in qtmir (Ubuntu):
importance: High → Critical
Changed in qtmir (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in unity8 (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Michał Sawicz (saviq)
Changed in qtmir (Ubuntu):
status: Triaged → In Progress
Changed in canonical-devices-system-image:
status: Triaged → In Progress
Changed in unity8 (Ubuntu):
status: Triaged → In Progress
Changed in canonical-devices-system-image:
milestone: u8c-2 → u8c-z
Changed in unity8 (Ubuntu):
status: In Progress → Invalid
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Have a fix for it. Just gotta update qtmir tests now before I can propose it for merging.

summary: - Unity 8 doesnt allow multiple mir connections from an application
+ Unity 8 doesn't allow multiple Mir connections from an application
instance
Revision history for this message
Gerry Boland (gerboland) wrote :

Relevant info to reproduce:

<bregma> Saviq, the first way to test the multiple-connection situation would probably be to create a custom .desktop file that removes GDK_BACKEND from the app's environment, which will force it to autoprobe and use Mir instead

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtmir - 0.5.1+17.04.20170404-0ubuntu1

---------------
qtmir (0.5.1+17.04.20170404-0ubuntu1) zesty; urgency=medium

  [ Albert Astals Cid ]
  * Remove m_tools member
  * EventInfo::store: Store an empty cookie for mir events without
    cookie

  [ Daniel d'Andrada ]
  * Support multiple sessions per Application (LP: #1675448)

 -- Lukáš Tinkl <email address hidden> Tue, 04 Apr 2017 00:47:22 +0000

Changed in qtmir (Ubuntu):
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.