Skip to content

Commit

Permalink
Temporary workaround for Kitura/Kitura#1034 (#211)
Browse files Browse the repository at this point in the history
* Kitura/Kitura#1034: Debugging second crash, sacrificial first field in IncomingSocketHandler

The crash always seems to relate to the first instance field of the IncomingSocketHandler class. Introducing a dummy one that is never used apparently avoids the crash.

* Add comment
  • Loading branch information
djones6 authored and quanvo87 committed Jul 25, 2017
1 parent 9f59c44 commit b5c3b26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/KituraNet/IncomingSocketHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ import Socket
public class IncomingSocketHandler {

static let socketWriterQueue = DispatchQueue(label: "Socket Writer")


// This variable is unused. It is a temporary workaround for a rare crash under load
// (see: https://github.com/IBM-Swift/Kitura/issues/1034) while a proper fix is
// investigated.
var superfluousOptional:String? = String(repeating: "x", count: 2)

#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS) || GCD_ASYNCH
static let socketReaderQueues = [DispatchQueue(label: "Socket Reader A"), DispatchQueue(label: "Socket Reader B")]

Expand Down

0 comments on commit b5c3b26

Please sign in to comment.